// 发送报告
var choice = "1";
$(function(){
var handlerChoice = function (captchaObj) {
    captchaObj.onReady(function () {
        $("#wait").hide();
    }).onSuccess(function () {
        var result = captchaObj.getValidate();
        if (!result) {
            return alert('请完成验证');
        }
        $("#challenge_1").val(result.geetest_challenge);
    	$("#validate_1").val(result.geetest_validate);
    	$("#seccode_1").val(result.geetest_seccode);
        if("1"==choice){
        	document.getElementById("bg").style.display ="block";document.getElementById("send_pdf_dialog").style.display ="block";
        }else if("2"==choice){
        	document.getElementById("bg").style.display ="block";document.getElementById("share_dialog").style.display ="block";
        }else if("3"==choice){        	
        	var/*string*/ entType = $("#entType").val();        	
    		saicobj.initInfoItem(entType);	
        }
    });
    $("#btn_send_pdf").on("click", function(){
    	choice = "1";
    	captchaObj.verify();
	});
    $("#btn_share").on("click", function(){
    	choice = "2";
    	captchaObj.verify();
    });
    $("#btn_print").on("click", function(){
    	choice = "3";
    	captchaObj.verify();
    });
    //信息打印确定按钮
    $("#pop-captcha-print").click(function () {
    	var /*boolean*/ isSele = saicobj.checkSele();
    	if(isSele)
    	{
    		document.getElementById("bg").style.display ="none";
        	document.getElementById('print_info').style.display = 'none';
    		saicobj.closeInfoItem();
            $("#f-form").submit();
    	}
    	else
    	{
    		var /*object*/ obj = document.getElementById("print_tips");
    		obj.style.display="block";
    	
//    		alert("请至少选择一个打印模块！");
    	}
    });
    // 更多前端接口说明请参见：http://docs.geetest.com/install/client/web-front/
};
$.ajax({
    url: "/SearchItemCaptcha?t=" + (new Date()).getTime(), // 加随机数防止缓存
    type: "get",
    dataType: "json",
    success: function (data) {

        // 调用 initGeetest 进行初始化
        // 参数1：配置参数
        // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它调用相应的接口
        initGeetest({
            // 以下 4 个配置参数为必须，不能缺少
            gt: data.gt,
            challenge: data.challenge,
            offline: !data.success, // 表示用户后台检测极验服务器是否宕机
            new_captcha: data.new_captcha, // 用于宕机时表示是新验证码的宕机
//            timeout: '5000',
            product: "bind", // 产品形式，包括：float，popup
            width: "300px"
            // 更多前端配置参数说明请参见：http://docs.geetest.com/install/client/web-front/
        }, handlerChoice);
    }
});
});
$(function(){
//	var datastamp_pdf = Date.parse(new Date());
//	$.getScript('http://static.geetest.com/static/tools/gt.js?v='+datastamp_pdf, function() {
//		var handlerPdfPopup = function (captchaObj) {
//	
//		    $("#pop-captcha-pdf").click(function () {
//		        var validate = captchaObj.getValidate();
//		        if (!validate) {
//	//	            alert('请先完成验证！');
//		            return;
//		        }
//		        document.getElementById("bg").style.display ="block";document.getElementById("send_pdf_dialog").style.display ="block";
//		    });
//
//		    // 弹出式需要绑定触发验证码弹出按钮
//		    captchaObj.bindOn("#pop-captcha-pdf");
//	
//		    // 将验证码加到id为captcha的元素里
//		    captchaObj.appendTo("#popup-captcha-pdf-div");
//		    // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
//		};
//	    $.ajax({
//	        // 获取id，challenge，success（是否启用failback）
//	        url: "/SearchItemCaptcha?v=" + datastamp_pdf,
//	        type: "get",
//	        dataType: "json",
//	        success: function (data) {
//	            // 使用initGeetest接口
//	            // 参数1：配置参数
//	            // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
//	            initGeetest({
//	                gt: data.gt,
//	                challenge: data.challenge,
//	                product: "popup", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
//	                offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
//	            }, handlerPdfPopup);
//	        }
//	    });
//	    $(function () {	 		
//	    	$("#btn_send_pdf").on("click", function(){
//	            $("#pop-captcha-pdf").trigger("click");
//	        });
//	    })
//	});
//	
//	//信息分享
//	var datastamp_share = Date.parse(new Date());
//	$.getScript('http://static.geetest.com/static/tools/gt.js?v='+datastamp_share, function() {
//		var handlerSharePopup = function (captchaObj) {
//	
//		    $("#pop-captcha-share").click(function () {
//		        var validate = captchaObj.getValidate();
//		        if (!validate) {
//	//	            alert('请先完成验证！');
//		            return;
//		        }
//		        document.getElementById("bg").style.display ="block";document.getElementById("share_dialog").style.display ="block";
//		    });
//	
//		    // 弹出式需要绑定触发验证码弹出按钮
//		    captchaObj.bindOn("#pop-captcha-share");
//	
//		    // 将验证码加到id为captcha的元素里
//		    captchaObj.appendTo("#popup-captcha-share-div");
//		    // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
//		};
//	    $.ajax({
//	        // 获取id，challenge，success（是否启用failback）
//	        url: "/SearchItemCaptcha?v=" + datastamp_share,
//	        type: "get",
//	        dataType: "json",
//	        success: function (data) {
//	            // 使用initGeetest接口
//	            // 参数1：配置参数
//	            // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
//	            initGeetest({
//	                gt: data.gt,
//	                challenge: data.challenge,
//	                product: "popup", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
//	                offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
//	            }, handlerSharePopup);
//	        }
//	    });
//	    $(function () {	 		
//	    	$("#btn_share").on("click", function(){
//	            $("#pop-captcha-share").trigger("click");
//	        });
//	    })
//	});
//	
//	// 信息打印
//	var datastamp_print = Date.parse(new Date());
//	$.getScript('http://static.geetest.com/static/tools/gt.js?v='+datastamp_print, function() {
//		var handlerPrintPopup = function (captchaObj) {
//	
//		    // 弹出式需要绑定触发验证码弹出按钮
//		    captchaObj.bindOn("#pop-captcha-print");
//	
//		    // 将验证码加到id为captcha的元素里
//		    captchaObj.appendTo("#popup-captcha-print-div");
//		    // 更多接口参考：http://www.geetest.com/install/sections/idx-client-sdk.html
//		    
//		    $("#pop-captcha-print").click(function () {
//		        var validate = captchaObj.getValidate();
//		        if (!validate) {
//	//	            alert('请先完成验证！');
//		            return;
//		        }
//		        $("#f-form").submit();
//		    });
//		};
//	    $.ajax({
//	        // 获取id，challenge，success（是否启用failback）
//	        url: "/SearchItemCaptcha?v=" + datastamp_print,
//	        type: "get",
//	        dataType: "json",
//	        success: function (data) {
//	            // 使用initGeetest接口
//	            // 参数1：配置参数
//	            // 参数2：回调，回调的第一个参数验证码对象，之后可以使用它做appendTo之类的事件
//	            initGeetest({
//	                gt: data.gt,
//	                challenge: data.challenge,
//	                product: "popup", // 产品形式，包括：float，embed，popup。注意只对PC版验证码有效
//	                offline: !data.success // 表示用户后台检测极验服务器是否宕机，一般不需要关注
//	            }, handlerPrintPopup);
//	        }
//	    });
//	    $(function () {	 		
//	    	$("#btn_print").on("click", function(){
//	            $("#pop-captcha-print").trigger("click");
//	        });
//	    })
//	});
	$(".fw-close").click(function(){
		$(this).parent().hide();
	});
});

var pledgeList = new Array();

//显示遮罩层    
function showMask(){     
    $("#mask").css("height",$(document).height());     
    $("#mask").css("width",$(document).width());     
    $("#mask").show();
    $(".image").show();
}  
//隐藏遮罩层  
function hideMask(){     
    $("#mask").hide();
    $(".image").hide();
}  
function convertDate(obj) {
    if (obj == null) {
        return "";
    } else {
        date = new Date(obj);
        return date.getFullYear() + "年" + (date.getMonth() + 1) + "月" + date.getDate() + "日"
    }
}
var entTypeToLab ={
    '1':{
        'base':true,
        'shareholder':true,
        'keyperson':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'stock':true,
        'check':true,
        'assist':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '101':{
        'base':true,
        'shareholder':true,
        'keyperson':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'stock':true,
        'check':true,
        'assist':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '2':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '3':{
        'base':true,
        'shareholder':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '4':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '5':{
        'base':true,
        'shareholder':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '6':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '7':{
        'base':true,
        'shareholder':true,
        'branch':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '8':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '9':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '10':{
        'base':true,
        'shareholder':true,
        'keyperson':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'stock':true,
        'check':true,
        'assist':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '1001':{
        'base':true,
        'shareholder':true,
        'keyperson':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'stock':true,
        'check':true,
        'assist':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '11':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '12':{
        'base':true,
        'shareholder':true,
        'branch':true,
        'clear':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
        'simplecancer':true,
    },
    '13':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '14':{
       'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '15':{
        'base':true,
        'shareholder':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'ill':true,
        'trademark':true,
        'copyright':true,
    },
    '16':{
        'base':true,
        'keyperson':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'trademark':true,
        'copyright':true,
       // 'simplecancer':true,
    },
    '17':{
        'base':true,
        'keyperson':true,
        'alter':true,
        'mort':true,
        'check':true,
        'annualreport':true,
        'instant':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'trademark':true,
        'copyright':true,
    },
    '18':{
        'base':true,
        'alter':true,
        'mort':true,
        'check':true,
        'other':true,
        'punish':true,
        'abnormal':true,
        'trademark':true,
        'copyright':true,
    },
};

var annualBranchInfo = null;
var annualLicenceInfo = null;
var vAnnualReportBranchProductionInfo = null;
var sponsorInfo = null;
var forGuaranteeinfo = null;
var alterEInfo = null;

var isOtherLicensing = false;

var entType = null;

var lable_map = {1: true};

function tablecolumns(columns) {
    var list = new Array();
    $.each(columns, function (x, value) {
        var obj = new Object();
        obj.data = value;
        list.push(obj);
    });
    return list;
}

function showAllData(name, row) {
    $("#" + name + "AllData" + row).css("display", "block");
    $("#" + name + "SubData" + row).css("display", "none");
}
function showSubData(name, row) {
    $("#" + name + "SubData" + row).css("display", "block");
    $("#" + name + "AllData" + row).css("display", "none");
}


function showShareHolder(entType) {
    if ((entType == 1)
        || (entType == 10)||(entType == 101)||(entType == 1001)) {
        if(entType==101 ||entType == 1001){
            $('#shareHolderForAll').html('发起人及出资信息<p style="text-align:center;color:#f00;display:inline-block;margin-left:40px;"><span id="font" style="font-size:16px;">发起人及出资信息截止2014年2月28日。2014年2月28日之后工商只公示发起人姓名，其他出资信息由企业自行公示。</span></p>');
            $('#shareholderInfo thead tr th').eq(1).html('发起人名称');
            $('#shareholderInfo thead tr th').eq(2).html('发起人类型');
        }
        var shareHolderColumns = ["index",
            "inv",
            "invType_CN",
            "blicType_CN",
            "bLicNo",
            "liSubConAm",
            "liAcConAm",
            "conDate",
            "invId"];
        var shareholder = $("#shareholderInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无股东及出资信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "ajax": {
                "url": shareholderUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'keyperson';
                }
            },
            "columns": tablecolumns(shareHolderColumns),
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('keyperson');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'keyperson';
                }
            },
            "columnDefs": [{
                "targets": 7,
                "render": function (data, type, row) {
                    var dateStamp = convertDate(row.conDate);
                    var date = convertDate('2014-03-01');
                    if (row.detailCheck == "true") {
                    	row.inv = row.inv.replace(/'/,'&rsquo;');
                    	return '<span class="clickToDetail" onclick="shareHodlerDetail('+'\'' + row.inv +'\''+ ','+'\'' + row.invId+'\'' + ')">查看</span>';
                    } else if (row.detailCheck == "false") {
                        return "";
                    }
                }
            }, {
                "targets": [5, 6],
                "visible": false
            },
                {
                    "targets": 8,
                    "visible": false
                }, {
                    "targets": [0],
                    "render": function (data, x, obj, index, y) {
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }, {
                    "targets": [3],
                    "render": function (data, type, row) {
						if(row.cerType_CN != ""){
							return "非公示项";
						}else if(row.cerType_CN == "" && row.blicType_CN != ""){
                        return row.blicType_CN;
						}else{
							return "非公示项";
						}
                    }
                }, 
                {
                    "targets": [4],
                    "render": function (data, type, row) {
						if(row.cerType_CN != ""){
							return "非公示项";
						}else if(row.cerType_CN == "" && row.blicType_CN != ""){
                        return row.bLicNo;
						}else{
							return "非公示项";
						}
                    }
                }, {
                    "targets": [2],
                    "render": function (data, type, row) {
//						if(row.cerType_CN != ""){
//							return row.cerType_CN;
//						}else if(row.cerType_CN == "" && row.blicType_CN != ""){
                        return row.invType_CN;
//						}else{
//							return "";
//						}
                    }
                }
            ]
        });
    }else if (entType == 5) {
        var shareHolderColumns = [
            "invId",
            "inv",
            "invType_CN",
            "blicType_CN",
            "bLicNo",
            ];
        var shareholder = $("#shareholderInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无合伙人信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "ajax": {
                "url": shareholderUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'keyperson';
                }
            },
            "columns": tablecolumns(shareHolderColumns),
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('keyperson');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'keyperson';
                }
            },
            "columnDefs": [{
                "targets": [0],
                "render": function (data, x, obj, index, y) {
                    return index.row + index.settings._iDisplayStart + 1;
                }
            }, {
                    "targets": [4],
                    "render": function (data, type, row) {
						if(row.cerType_CN){
                            return '非公示项';
                        }
                        return data;	
                    }
                },{
                    "targets": [3],
                    "render": function (data, type, row) {
                        if(row.cerType_CN){
                            return '非公示项';
                        }
                        return data;
                    }
                },{
                    "targets":[5],
                    "visible":false,
                }
            ]
        });
    }else if (entType == 12) {
        var shareHolderColumns = [
            "invId",
            "inv",
            "invType_CN",
            "blicType_CN",
            "bLicNo",
            "country_CN",
            "dom",
            "respForm_CN"
            ];
        var shareholder = $("#shareholderInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无合伙人信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "ajax": {
                "url": shareholderUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'keyperson';
                }
            },
            "columns": tablecolumns(shareHolderColumns),
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('keyperson');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'keyperson';
                }
            },
            "columnDefs": [{
                "targets": [5,6,7],
                "visible":false,
            },{
                "targets": [0],
                "render": function (data, x, obj, index, y) {
                    return index.row + index.settings._iDisplayStart + 1;
                }
            }, {
                    "targets": [4],
                    "render": function (data, type, row) {
                        if(row.cerType_CN){
                            return '非公示项';
                        }
                        return data;    
                    }
                },{
                    "targets": [3],
                    "render": function (data, type, row) {
                        if(row.cerType_CN){
                            return '非公示项';
                        }
                        return data;
                    }
                }
            ]
        });
    }else if (entType == 7) {
        var shareHolderColumns = ["invId", "inv",
            "sConForm_CN"];
        customtable("shareholderInfo", shareholderUrl, shareHolderColumns, "投资人");

        n_h = $('#footer_ac').offset().top;
        s_t = getbodyST();
        if(n_h<s_t+more_h){
            addNext('keyperson');
        }else{
            !isLoaded['all'] && $('#addmore').show();
            now_sec = 'keyperson';
        }
        /*var shareholder = $("#shareholderInfo").DataTable({
         "bAutoWidth": false,
         "pagingType":   "full_numbers",
         "language": {
         "processing": "正在加载，请稍后",
         "lengthMenu": "显示 _MENU_ 项结果",
         "zeroRecords": "没有匹配结果",
         "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
         "infoEmpty": "共 查询到 0 条记录    共 0 页",
         "infoFiltered": "(由 _MAX_ 项结果过滤)",
         "infoPostFix": "",
         "url": "",
         "paginate": {
         "first":    "|<",
         "previous": "<<",
         "next":     "下一页",
         "last":     "末页"
         }
         },
         "processing" : true,
         "serverSide" : true,
         "ordering":false,
         "ajax"  : {
         "url": shareholderUrl,
         "type": "POST"
         } ,
         "columns": tablecolumns(shareHolderColumns)
         });*/
    }else if (entType == 15) {
        var shareHolderColumns = ["invId",
            "inv",
            "respForm_CN"];
        var shareholder = $("#shareholderInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无合作各方信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "ajax": {
                "url": shareholderUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'keyperson';
                }
            },
            "columns": tablecolumns(shareHolderColumns),
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('keyperson');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'keyperson';
                }
            },
            "columnDefs": [
                {
                    "targets": [0],
                    "render": function (data, x, obj, index, y) {
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }
            ]
        });
    }else if (entType == 3) {
        var shareHolderColumns = ["invId",
            "inv",
            "respForm_CN"];
        var shareholder = $("#shareholderInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无主管部门（出资人）信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "serverSide": true,
            "ordering": false,
            "ajax": {
                "url": shareholderUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'keyperson';
                }
            },
            "columns": tablecolumns(shareHolderColumns),
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('keyperson');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'keyperson';
                }
            },
            "columnDefs": [{
                "targets": [0],
                "render": function (data, x, obj, index, y) {
                    return index.row + index.settings._iDisplayStart + 1;
                }
            },{
                "targets": [1],
                "render": function (data, type, row) {
                    return row.inv;
                }
            }, {
                    "targets": [3],
                    "render": function (data, type, row) {
								if(row.cerType_CN != ""){
									return "非公示项";
								}else if(row.cerType_CN == "" && row.blicType_CN != ""){
									return row.blicType_CN;
								}else{
									return "非公示项";
								}
                    }
                },
                {
                    "targets": [4],
                    "render": function (data, type, row) {
								if(row.cerType_CN != ""){
									return "非公示项";
								}else if(row.cerType_CN == "" && row.blicType_CN != ""){
									return row.bLicNo;
								}else{
									return "非公示项";
								}
                    }
                },{
                    "targets": [2],
                    "render": function (data, type, row) {
                        return row.invType_CN;
                    }
                },{
                    "targets": [5],
                    "render": function (data, type, row) {
                    	var javascriptDate = convertDate(row.conDate);
                        return javascriptDate;
                    }
                }
            ]
        });
    }
}

function showKeyPerson() {
	if(entType != 16)
        $('.people-list').html("");
    else
        $('.people-listforpb').html("");
	
	var entType = $('#entType').val();
	var isShowJob = false;
	if(entType==1 || entType==10||entType==101||entType==1001){
		isShowJob = true;
	}
    if (entType == 16)
        keyPersonUrl = gtKeyPersonUrl;
	
	var num ='0';
    $.ajax({
        url: keyPersonUrl,
        success: function (data) {
            //如果没有参加经营的家庭成员信息
            if (data.data && data.data.length <= 0) {             	
            	if(entType==16){
            		$('#personInfo').html("").html("<tr class='odd'><td  style='background:#F3F7FA;color:#666' width='1077px' id='dataTables_empty' >暂无参加经营的家庭人员信息</td></tr>");  
            	} else if(entType == 17){
            		$('#personInfo').html("").html("<tr class='odd'><td  style='background:#F3F7FA;color:#666' width='1077px' id='dataTables_empty' >暂无成员名册信息</td></tr>");
            	} else {
                    $('#personInfo').html("").html("<tr class='odd'><td  style='background:#F3F7FA;color:#666' width='1077px' id='dataTables_empty' >暂无主要人员信息</td></tr>");
                }
            } else {
                if (data.totalPage > 1) {
                    var allKeypersonInfoUrl = keyPersonAllUrl;
                    $("#keyperForAll .personCount").append("<a href='"+allKeypersonInfoUrl+"' target='_blank'><<查看全部>></a>");
                }
                var length = data.data && data.data.length;  
                $('#perCount').html('共计 '+data.recordsTotal+' 条信息');          	                 
                for (var i = 0; i < length; i++) {    
                	 var str = "";
                     var addTit = '';
                    if (isShowJob && data.data[i].position_CN != null && data.data[i].position_CN != "" 
                      && data.data[i].position_CN.length > 0 ){
                    	
                    		if (data.data[i].position_CN.indexOf('<img') == -1) {
                                str = data.data[i].position_CN.substring(0, 6);
                                str += "...";
                                addTit = '<span style= "font-size:14px;line-height:1" title="' + data.data[i].position_CN + '">' + str + '</span>';
                            } else {
                                str = data.data[i].position_CN;
                                addTit = '<span >' + data.data[i].position_CN + '</span>';
                            }                          		
                    }
                    if(entType != 16)
                        $('.people-list').append('<li><a><div class="people-list-div list'+num+'">' + data.data[i].name + '</div>' + '<div class="people-list-position">' + addTit + '</div>' + '</a></li>');
                    else
                        $('.people-listforpb').append('<li><a><div class="people-list-div list'+num+'">' + data.data[i].name + '</div>' + '<div class="people-list-position">' + addTit + '</div>' + '</a></li>');
                    var name_div=$(".list"+num);
                    if(name_div.height()>30){
                        name_div.attr('style',"white-space:nowrap;overflow:hidden;text-overflow:ellipsis;height:25px");
                        name_div.find('.dp').remove();                    
                        var name = $(".list"+num).html();                  
                        name_div.attr("title",name);
                    }
                    num++;       
                }
            }

            //是否继续渲染
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('branch');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'branch';
            }

        },
        error:function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('branch');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'branch';
            }
        }
    });
    
}


function showBranch() {
    //分支机构信息   以及判断查看全部的内容在这
    $.ajax({
        url: branchUrl,
        success: function (data) {
    	 //如果没有分支机构信息
            if (data.totalPage > 1) {
                var allBranchInfoUrl = branchUrlAll;
                $("#branchForAll .personCount").append("<a href='" + allBranchInfoUrl + "' target='_blank'><<查看全部>></a>");
            }
            if (data == null || data.data == null || data.data.length <= 0) {
                $('#branchGroupForAll').append("<tr class='odd'><td  style='background:#F3F7FA;color:#666' width='1077px' id='dataTables_empty' colspan='4'>暂无分支机构信息</td></tr>");            
            }else{
                var length = data.data && data.data.length;
                $('#branchCount').html('共计  '+data.recordsTotal+' 条信息');
                var str =""
                for (var i = 0; i < data.data.length; i++) {
                    var str1 = "";
                    if (data.data[i].brName != null && data.data[i].brName != "" && data.data[i].brName.length > 0) {
                        if (data.data[i].brName.length > 22) {
                            str1 = data.data[i].brName.substring(0, 22);
                            str1 += "...";
                        } else {
                            str1 = data.data[i].brName;
                        }
                    }

                    var str2 = "";
                    if (data.data[i].regOrg_CN != null && data.data[i].regOrg_CN != "" && data.data[i].regOrg_CN.length > 0) {
                        if (data.data[i].regOrg_CN.length > 21) {
                            str2 = data.data[i].regOrg_CN.substring(0, 21);
                            str2 += "...";
                        } else {
                            str2 = data.data[i].regOrg_CN;
                        }
                    
                    }
                    if(data.data[i].uniscId !=null && data.data[i].uniscId !=""){
                    	 str+='<li class="branchInfo-list" ><a><div style="font-size:14px;color:#333333;" title="' + data.data[i].brName + '">'
                         + str1 + '</div><span style="font-size:12px;color:#666666;">· 统一社会信用代码/注册号 :'
                         + '<span style="font-size:12px;color:#333333;">' + data.data[i].uniscId + '</span><div style="font-size:12px;color:#666666;">· 登记机关 : '
                         + '<span title="' + data.data[i].regOrg_CN + '" style="font-size:12px;color:#333333;">' + str2 + '</span></div></a></li>';
                    }else{
                    	 str+='<li class="branchInfo-list" ><a><div style="font-size:14px;color:#333333;" title="' + data.data[i].brName + '">'
                         + str1 + '</div><span style="font-size:12px;color:#666666;">· 统一社会信用代码/注册号 :'
                         + '<span style="font-size:12px;color:#333333;">' + data.data[i].regNo + '</span><div style="font-size:12px;color:#666666;">· 登记机关 : '
                         + '<span title="' + data.data[i].regOrg_CN + '" style="font-size:12px;color:#333333;">' + str2 + '</span></div></a></li>';
                    }
                }
                $('#branchGroupForAll').html(str);
            }
            //是否继续渲染
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('clear');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'clear';
            }
        },
        error:function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('clear');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'clear';
            }
        }
        
    });

}
function toggleMsg(){
    $('.yichangMsg').css('display') =='none'? $('.yichangMsg').css({display:'block'}):$('.yichangMsg').css({display:'none'});
}

function showAlterInfo(entType) {
    var alterInfoColumns = [
        "altId",
        "altItem_CN",
        "altBe",
        "altAf",
        "altDate"];
    
    var columnnames = tablecolumns(alterInfoColumns);
    if (entType != 16) {
        var alterInfo = $("#altInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无变更信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "ordering": false,
            "serverSide": true,
            "ajax": {
                "url": alterInfoUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'mort';
                }
            },
            "columns": columnnames,
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('mort');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'mort';
                }
            },
            "columnDefs": [{
                "targets": 2,
                "render": function (data, x, obj, index) {
                    if (data.length > 44) {
                        var dataNew = data;
                        dataNew = dataNew.substring(0, 44) + "...";
                        var subDiv = "<div id=\"altInfoBeSubData" + index.row + "\"><span title='" + data + "'>" + dataNew + "</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('altInfoBe', " + index.row + ")\">更多</a></div>";
                        var allDiv = "<div id=\"altInfoBeAllData" + index.row + "\" style=\"display:none;\"><span title='" + data + "'>" + data + "</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('altInfoBe', " + index.row + ")\">收起</a></div>";
                        return subDiv + allDiv;
                    } else {
                        return "<div id=\"altInfoSubData" + index.row + "\"><span title='" + data + "'>" + data + "</span></div>"
                    }
                }
            },
                {
                    "targets": 3,
                    "render": function (data, x, obj, index) {
                        if (data.length > 44) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0, 44) + "...";
                            var subDiv = "<div id=\"altInfoAfSubData" + index.row + "\"><span title='" + data + "'>" + dataNew + "</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('altInfoAf', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"altInfoAfAllData" + index.row + "\" style=\"display:none;\"><span title='" + data + "'>" + data + "</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('altInfoAf', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"altInfoSubData" + index.row + "\"><span title='" + data + "'>" + data + "</span></div>"
                        }
                    }
                }, {
                    "targets": 4,
                    "render": function (data) {
                        var javascriptDate = convertDate(data);
                        return "<tr>" + javascriptDate + "</tr>";
                    }
                }, {
                    "targets": [0],
                    "render": function (data, x, obj, index, y) {
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
        /*	alterInfo.on('draw.dt',
         function(){
         alterInfo.column(0).nodes().each(function(cell,i){
         cell.innerHTML = i + 1;
         })
         })*/
    } else {
        var alterInfo = $("#altInfo").DataTable({
            "bAutoWidth": false,
            "pagingType": "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无变更信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first": "首页",
                    "previous": "上一页",
                    "next": "下一页",
                    "last": "末页"
                }
            },
            "processing": true,
            "ordering": false,
            "serverSide": true,
            "ajax": {
                "url": gtAlertInfoUrl,
                "type": "POST",
                "error":function(){
                    now_sec = 'mort';
                }
            },
            "columns": columnnames,
            "fnDrawCallback":function(){
                n_h = $('#footer_ac').offset().top;
                s_t = getbodyST();
                if(n_h<s_t+more_h){
                    addNext('mort');
                }else{
                    !isLoaded['all'] && $('#addmore').show();
                    now_sec = 'mort';
                }
            },
            "columnDefs": [{
                "targets": 1,
                "render": function (data) {
                    return "<span title='" + data + "'>" + data + "</span>";
                }
            },
                {
                    "targets": 2,
                    "render": function (data, x, obj, index) {
                        if (data.length > 44) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0, 44) + "...";
                            var subDiv = "<div id=\"altInfoBeSubData" + index.row + "\"><span title='" + data + "'>" + dataNew + "</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('altInfoBe', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"altInfoBeAllData" + index.row + "\" style=\"display:none;\"><span title='" + data + "'>" + data + "</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('altInfoBe', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"altInfoSubData" + index.row + "\"><span title='" + data + "'>" + data + "</span></div>"
                        }
                    }
                },
                {
                    "targets": 3,
                    "render": function (data, x, obj, index) {
                        if (data.length > 44) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0, 44) + "...";
                            var subDiv = "<div id=\"altInfoAfSubData" + index.row + "\"><span title='" + data + "'>" + dataNew + "</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('altInfoAf', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"altInfoAfAllData" + index.row + "\" style=\"display:none;\"><span title='" + data + "'>" + data + "</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('altInfoAf', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"altInfoSubData" + index.row + "\"><span title='" + data + "'>" + data + "</span></div>"
                        }
                    }
                }, {
                    "targets": 4,
                    "render": function (data) {
                        var javascriptDate = convertDate(data);
                        return "<tr>" + javascriptDate + "</tr>";
                    }
                }, {
                    "targets": [0],
                    "render": function (data, x, obj, index, y) {
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
        /*		alterInfo.on('draw.dt',
         function(){
         alterInfo.column(0).nodes().each(function(cell,i){
         cell.innerHTML = i + 1;
         })
         })*/
    }

}

function showClearingInfo() {
    $.ajax({
        url: liquidationUrl,
        success: function (data) {
            if (data.data && data.data.length > 0) {
                for (var i = 0; i < data.data.length; i++) {
                    if (data.data[i].ligpriSign == 1) {
                        $("#bankRuptcy").append("<tr><td>清算组负责人</td><td colspan='4'>" + data.data[i].liqMem + "</td></tr>");
                        break;
                    }
                }
                //清算组的成员  除去清算负责人
                var listForMe = new Array();
                for (var i = 0; i < data.data.length; i++) {
                    if (data.data[i].ligpriSign != 1) {
                        listForMe.push(data.data[i]);
                    }
                }
//				var members = data.data[0].liqMem.split("、");
                var columns = listForMe.length / 4;
                if (columns == 0) {
                    if (listForMe.length == 1) {
                        $("#bankRuptcy").append("<tr><td>清算组成员</td><td colspan='4'>" + listForMe[0].liqMem + "</td><td></td><td></td><td></td></tr>");
                    } else if (listForMe.length == 2) {
                        $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[0].liqMem + "</td><td colspan='2'>" + listForMe[1].liqMem + "</td><td></td><td></td></tr>");
                    } else if (listForMe.length == 3) {
                        $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[0].liqMem + "</td><td>" + listForMe[1].liqMem + "</td><td>" + listForMe[2].liqMem + "</td><td></td></tr>");
                    } else if (listForMe.length == 4) {
                        $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[0].liqMem + "</td><td>" + listForMe[1].liqMem + "</td><td>" + listForMe[2].liqMem + "</td><td>" + listForMe[3].liqMem + "</td></tr>");
                    }
                }
                for (var i = 0; i < columns; i++) {
                    if ((i + 1) > columns) {
                        if (listForMe.length % 4 == 1) {
                            $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[(4 * i + 0)].liqMem + "</td><td></td><td></td><td></td></tr>");
                        } else if (listForMe.length % 4 == 2) {
                            $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[(4 * i + 0)].liqMem + "</td><td>" + listForMe[(4 * i + 1)].liqMem + "</td><td></td><td></td></tr>");
                        } else if (listForMe.length % 4 == 3) {
                            $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[(4 * i + 0)].liqMem + "</td><td>" + listForMe[(4 * i + 1)].liqMem + "</td><td>" + listForMe[(4 * i + 2)].liqMem + "</td><td></td></tr>");
                        } else if (listForMe.length % 4 == 4) {
                            $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[(4 * i + 0)].liqMem + "</td><td>" + listForMe[(4 * i + 1)].liqMem + "</td><td>" + listForMe[(4 * i + 2)].liqMem + "</td><td>" + listForMe[(4 * i + 3)].liqMem + "</td></tr>");
                        }
                    } else {
                        $("#bankRuptcy").append("<tr><td>清算组成员</td><td>" + listForMe[(4 * i + 0)].liqMem + "</td><td>" + listForMe[(4 * i + 1)].liqMem + "</td><td>" + listForMe[(4 * i + 2)].liqMem + "</td><td>" + listForMe[(4 * i + 3)].liqMem + "</td></tr>");
                    }
                }
            } else {
                $("#bankForNow").find("table").remove();
                $('#bankForNow').append("<tr class='odd'><td  style='background:#F3F7FA;width:1077px;color:#666;' id='dataTables_empty' colspan='4'>暂无清算信息</td></tr>");
            }

            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('alter');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'alter';
            }
        },
        error:function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('alter');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'alter';
            }
        }
    });
}

function showPunishInfo(entType){
    //警示信息中   行政处罚信息  是否出现查看按钮
   /* $.ajax({
        url: punishmentDetailInfoUrl,
        success: function(data){
            // if(data.totalPage > 2){
            //     $("#punishMentAll").append("<a href='"+punishmentAllUrl+"' target='_blank'>" +
            //         "查看全部 &gt;&gt;</a>");
            // }
        }
    });*/

    num = 0;
    var tab = $("#tab").val();
    if(window.location.search.split("&")[1] !=null){
        tab = window.location.search.split("&")[1].substr(4)
    }

    var str = "";
    var str2 ="";
    var dd=0;
    // 警示信息中  行政处罚信息
    var punishmentInfo = $("#needPaging_punish").DataTable({
        "columns" : [{"class":"nopadding"}],
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无行政处罚信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "serverSide" : true,
        "ordering":false,
        "ajax" : {
            "url":punishmentDetailInfoUrl,
            "type":"POST"
        },
        "columnDefs" : [
            {
                "targets":0,
                "width":1070,
                "render": function(data,type,row,index){
                    dd++;
                    str2 ="";
                    var javascriptDate = convertDate(row.penDecIssDate);
                    var javascriptDate1 = convertDate(row.publicDate);

                    str = "";
                    if(row.vPunishmentAltInfo != null && row.vPunishmentAltInfo.length > 1){
                        var count = 2;
                        var num = row.vPunishmentAltInfo.length;
                        for(var i =1;i<row.vPunishmentAltInfo.length;i++){
                            var javadate = convertDate(row.vPunishmentAltInfo[i].altDate);
                            str =    str +"<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '7' style='color:#F92220'>"+"&nbsp&nbsp&nbsp&nbsp&nbsp" +
                                "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp"+(count++)+"、"+row.vPunishmentAltInfo[i].penAuth_CN+"在"+javadate+"将" + row.vPunishmentAltInfo[i].alt + "</td></tr>";
                        }
                    }

                    var charToo = null;
                    if(row.vPunishmentAltInfo != null  && row.vPunishmentAltInfo.length > 0 ){
                        charToo = row.vPunishmentAltInfo[0];

                    }
                    var str3 ="";
                    if(charToo != null){
                        var javadate = convertDate(charToo.altDate);
                        str3 ="<td class='feiwuClass' ></td><td class= 'testClass' colspan = '7' style='color:#F92220'>"+"有变更情形  : 1、"+charToo.penAuth_CN+"在"+javadate+"将"  +charToo.alt  + "</td>";
                    }

                    if(row.penContent.length>30){
                        var subdata = row.penContent.substring(0, 30)+'...<a style="cursor:pointer;float:right" onclick=showMore(this)>更多</a>';
                        var penContent = '<div style="text-align:left" title="'+row.penContent+'">'+subdata+'</div><div style="display:none;text-align:left">'+row.penContent+'<a style="cursor:pointer;float:right" onclick="hideMore(this)">收起</a></div>';
                    }else{
                        var penContent= row.penContent;
                    }
             
                    if(row.type == 1){
                        if(row.vPunishmentDecision != null){
                        	var entType = $("#entType").val();
                        	/*if (entType == 16)
                        		entTypeStr = "GT";
                        	else
                        		entTypeStr = "QY";*/
                            //var span =  "<a target='_blank' href ='/corp-query-entprise-allInfo-punishForPdf-"+row.caseId+".html?nodenum="+row.nodeNum+"&enttype="+entTypeStr+"'>查看</a>";                                                                                   
                        	var span =  '<a target="_blank" href ="'+row.detailUrl+'?entType='+entType+'">查看</a>';
                        }
                        var  span2 =  "<span class='clickToDetail' onclick=punishmentDetail("+"'"
                            +row.caseId+"'"+")>查看</span>";
                    }else{
                        var span = "";
                        var span2 ="";
                    }

                    if(row.illegActType && row.illegActType.length>30){
                        var ill_str = '<div style="text-align:left" title="'+row.illegActType+'">'+row.illegActType.substring(0,30)+'...<a style="display:inline-block;float:right;cursor:pointer" onclick="showMore(this)">更多</a></div><div style="text-align:left;display:none;">'+row.illegActType+'<a style="display:inline-block;float:right;cursor:pointer" onclick="hideMore(this)">收起</a></div>';
                    }else{
                        var ill_str = row.illegActType;
                    }

                    if(str == ""){
                        if(charToo != null){
                            if(row.vPunishmentDecision != null){
                                return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                    "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                    "<td width='151px' >"+row.penDecNo+"</td>" +
                                    "<td width='112px' >"+ill_str+"</td>"+
                                    "<td width='140px'><div>"+penContent+"</div></td>"+
                                    "<td width='197px' >"+row.penAuth_CN+"</td>"+
                                    "<td width='120px' >"+javascriptDate+"</td>"+
                                    "<td width='120px' >"+javascriptDate1+"</td>"+
                                    "<td width='48px' class='idiot'>"+span
                                    +"</td>"+
                                    "</tr><tr>" +"" +
                                    ""+str3 +
                                    "</tr>" +
                                    "" +
                                    "" +
                                    "</table></div><td>";
                            }else{
                                return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                    "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                    "<td width='151px' >"+row.penDecNo+"</td>" +
                                    "<td width='112px' >"+ill_str+"</td>"+
                                    "<td width='140px'><div>"+penContent+"</div></td>"+
                                    "<td width='197px' >"+row.penAuth_CN+"</td>"+
                                    "<td width='120px' >"+javascriptDate+"</td>"+
                                    "<td width='120px' >"+javascriptDate1+"</td>"+
                                    "<td width='48px' class='idiot'>"+span2+"</td>"+
                                    "</tr><tr>" +"" +
                                    ""+str3 +
                                    "</tr>" +
                                    "" +
                                    "" +
                                    "</table></div><td>";
                            }
                        }else{
                            if(row.vPunishmentDecision != null){
                                return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                    "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                    "<td width='151px' >"+row.penDecNo+"</td>" +
                                    "<td width='112px' >"+ill_str+"</td>"+
                                    "<td width='140px'><div>"+penContent+"</div></td>"+
                                    "<td width='197px' >"+row.penAuth_CN+"</td>"+
                                    "<td width='120px' >"+javascriptDate+"</td>"+
                                    "<td width='120px' >"+javascriptDate1+"</td>"+
                                    "<td width='48px' class='idiot'>"+
                                    span+"</td>"+
                                    "</tr>" +
                                    "" +
                                    "" +
                                    "</table></div><td>";
                            }else{
                                return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                    "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                    "<td width='151px' >"+row.penDecNo+"</td>" +
                                    "<td width='112px' >"+ill_str+"</td>"+
                                    "<td width='140px'><div>"+penContent+"</div></td>"+
                                    "<td width='197px' >"+row.penAuth_CN+"</td>"+
                                    "<td width='120px' >"+javascriptDate+"</td>"+
                                    "<td width='120px' >"+javascriptDate1+"</td>"+
                                    "<td width='48px' class='idiot'>"+span2+"</td>"+
                                    "</tr>" +
                                    "" +
                                    "" +
                                    "</table></div><td>";
                            }
                        }
                    }else{
                        if(row.vPunishmentDecision != null){
                            return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                "<td width='151px' >"+row.penDecNo+"</td>" +
                                "<td width='112px'>"+ill_str+"</td>"+
                                "<td width='140px'><div>"+penContent+"</div></td>"+
                                "<td width='197px'>"+row.penAuth_CN+"</td>"+
                                "<td width='120px'>"+javascriptDate+"</td>"+
                                "<td width='120px'>"+javascriptDate1+"</td>"+
                                "<td width='48px' class='idiot'>"+
                                span+"</td>"+
                                "</tr><tr>" +"" +
                                ""+str3 +
                                ""+str+""+
                                "</tr>" +
                                "" +
                                "" +
                                "</table></div><td>";
                        }else{
                            return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                "<td width='48px'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>"+
                                "<td width='151px' >"+row.penDecNo+"</td>" +
                                "<td width='112px'>"+ill_str+"</td>"+
                                "<td width='140px'><div>"+penContent+"</div></td>"+
                                "<td width='197px'>"+row.penAuth_CN+"</td>"+
                                "<td width='120px'>"+javascriptDate+"</td>"+
                                "<td width='120px'>"+javascriptDate1+"</td>"+
                                "<td width='48px' class='idiot'>"+span2+"</td>"+
                                "</tr><tr>" +"" +
                                ""+str3 +
                                ""+str+""+
                                "</tr>" +
                                "" +
                                "" +
                                "</table></div><td>";
                        }
                    }
                }
            }

        ]
    });
}

function showOtherLicInfo(){
    var str = "";
    var str2 = "";
    var dd = 0;
    var otherLicenceInfoColumns = ["licNo",
        "licNo",
        "licName_CN",
        "valFrom",
        "valTo",
        "licAnth",
        "licItem",
        "status_CN",
        "licId",
        "alt"
    ];
    var otherLicenceInfo = $("#needPaging_otherLicensing").DataTable({
        "bAutoWidth": false,
        "pagingType": "full_numbers",
        "columns": [{"class": "nopadding"}],
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无行政许可信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "显示第 0 至 0 项结果，共 0 项",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first": "首页",
                "previous": "上一页",
                "next": "下一页",
                "last": "末页"
            }
        },
        "processing": true,
        "serverSide": true,
        "ordering": false,
        "ajax": {
            "url": otherLicenceDetailInfoUrl,
            "type": "POST"
        },
        "columnDefs": [


            {
                "targets": 0,
                "width": 1070,
                "render": function (data, type, row, index) {
                    dd++;
                    str2 = "";
                    var javascriptDate = convertDate(row.valFrom);
                    var javascriptDate1 = convertDate(row.valTo);

                    str = "";
                    if (row.votherAlterlicenceinfo != null && row.votherAlterlicenceinfo.length > 1) {
                        var dateForAlterjava = convertDate(row.votherAlterlicenceinfo.altDate);

                        var count = 2;
                        var num = row.votherAlterlicenceinfo.length;
                        for (var i = 1; i < row.votherAlterlicenceinfo.length; i++) {
                            str = str + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '7' style='color:#F92220'>" + "&nbsp&nbsp&nbsp&nbsp&nbsp" +
                                "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" + (count++) + "、" + dateForAlterjava + "将" + row.votherAlterlicenceinfo[i].alt + "由" + row.votherAlterlicenceinfo[i].altBe + "变更为" +
                                "" + row.votherAlterlicenceinfo[i].altAf + "</td></tr>";
                        }
                    }

                    var charToo = null;
                    if (row.votherAlterlicenceinfo != null) {
                        charToo = row.votherAlterlicenceinfo[0];
                    }
                    var str3 = "";
                    if (charToo != null) {
                        var dateForAlterjava = convertDate(charToo.altDate);
                        str3 = "<td class='feiwuClass' ></td><td class= 'testClass' colspan = '7' style='color:#F92220'>" + "有变更情形  : 1、" + dateForAlterjava + "将" + charToo.alt + "由" + charToo.altBe + "变更为" +
                            "" + charToo.altAf + "</td>";
                    }

                    //收起更多
                    var strMore = "";
                    if (row.licItem.length > 23) {
                        var dataNew = row.licItem;
                        dataNew = dataNew.substring(0, 23) + "...";
                        var subDiv = "<div id=\"LicensingSubData" + index.row + "\"><span title='" + row.licItem + "'>" + dataNew + "</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('Licensing', " + index.row + ")\">更多</a></div>";
                        var allDiv = "<div id=\"LicensingAllData" + index.row + "\" style=\"display:none;\"><span title='" + row.licItem + "'>" + row.licItem + "</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('Licensing', " + index.row + ")\">收起</a></div>";
                        strMore = subDiv + allDiv;
                    } else {
                        strMore = "<div id=\"LicensingSubData" + index.row + "\"><span title='" + row.licItem + "'>" + row.licItem + "</span></div>";
                    }


                    if (str == "") {
                        if (charToo != null) {
                            return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                "<td width='44px'>" + (index.row + index.settings._iDisplayStart + 1) + "</td>" +
                                "<td width='131px' >" + row.licNo + "</td>" +
                                "<td width='132px' >" + row.licName_CN + "</td>" +
                                "<td width='100px'>" + javascriptDate + "</td>" +
                                "<td width='100px' >" + javascriptDate1 + "</td>" +
                                "<td width='140px' >" + row.licAnth + "</td>" +
                                "<td width='150px' >" + strMore + "</td>" +
                                "</tr><tr style='display:none'>" + "" +
                                "" + str3 +
                                "</tr>" +
                                "" +
                                "" +
                                "</table></div><td>";
                        } else {
                            return "<td><div  class='specialtd'><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                                "<td width='44px'>" + (index.row + index.settings._iDisplayStart + 1) + "</td>" +
                                "<td width='131px' >" + row.licNo + "</td>" +
                                "<td width='132px' >" + row.licName_CN + "</td>" +
                                "<td width='100px'>" + javascriptDate + "</td>" +
                                "<td width='100px' >" + javascriptDate1 + "</td>" +
                                "<td width='140px' >" + row.licAnth + "</td>" +
                                "<td width='150px' >" + strMore + "</td>" +
                                "</tr>" +
                                "" +
                                "" +
                                "</table></div><td>";
                        }
                    } else {
                        return "<td><div  class='specialtd' ><table frame='void' rules='rows' width='1070px'><tr width='1070px'>" +
                            "<td width='44px'>" + (index.row + index.settings._iDisplayStart + 1) + "</td>" +
                            "<td width='131px' >" + row.licNo + "</td>" +
                            "<td width='132px'>" + row.licName_CN + "</td>" +
                            "<td width='100px'>" + javascriptDate + "</td>" +
                            "<td width='100px'>" + javascriptDate1 + "</td>" +
                            "<td width='140px'>" + row.licAnth + "</td>" +
                            "<td width='150px'>" + strMore + "</td>" +
                            "</tr><tr style='display:none'>" + "" +
                            "" + str3 +
                            "" + str + "" +
                            "</tr>" +
                            "" +
                            "" +
                            "</table></div><td>";
                    }
                }
            }, {
                "targets": [0],
                "render": function (data, x, obj, index, y) {
                    return index.row + index.settings._iDisplayStart + 1;
                }
            }
        ]
    });
}

function showOperAbnormalInfo(entType){

    // 警示信息中 经营异常ent_bus_excep
    var entBusExcepInfoColumns = [
        "abntime",
        "speCause_CN",
        "abntime",
        "decOrg_CN",
        "remExcpRes_CN",
        "remDate",
        "reDecOrg_CN"
    ]

    var result = entType;
    if(result == 16){
        //警示信息中 经营异常ent_bus_excep
        var indBusExcepInfo = $("#needPaging_abnormal").DataTable({
            /*"initComplete": function(settings, json) {
                num++;
                if(num == totalTablesCount){
                    if(tab == "excep_tab"){
                        window.location.href='#excep_tab';
                    }
                    if(tab == "ill_tab"){
                        window.location.href='#ill_tab';
                    }
                }
            },*/
            "bAutoWidth": false,
            "pagingType":   "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无列入经营异常名录信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first":    "首页",
                    "previous": "上一页",
                    "next":     "下一页",
                    "last":     "末页"
                }
            },
            "processing" : true,
            "serverSide" : true,
            "ordering":false,
            "ajax" : {
                "url":indBusExcepUrl,
                "type":"POST"
            },
            "columns" : tablecolumns(entBusExcepInfoColumns),
            "columnDefs" : [{
                "targets" : [2,5],
                "render":function(data){
                    var javascriptDate = convertDate(data);
                    return "<tr>"+javascriptDate+"</tr>";
                }
            },
                {
                    "targets" : 1,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalIn', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalInAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalIn', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },
                {
                    "targets" : 4,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalOut', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalOutAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalOut', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },{
                    "targets" : [0],
                    "render":function(data, x, obj, index, y){
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
        indBusExcepInfo.on('draw.dt',
            function(){
                indBusExcepInfo.column(0).nodes().each(function(cell,i){
                    cell.innerHTML = i + 1;
                })
            })
    } else if(result == 17){
        //警示信息中 经营异常ent_bus_excep
        var argBusExcepInfo = $("#needPaging_abnormal").DataTable({
            /*"initComplete": function(settings, json) {
                num++;
                if(num == totalTablesCount){
                    if(tab == "excep_tab"){
                        window.location.href='#excep_tab';
                    }
                    if(tab == "ill_tab"){
                        window.location.href='#ill_tab';
                    }
                }
            },*/
            "bAutoWidth": false,
            "pagingType":   "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无列入经营异常名录信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first":    "首页",
                    "previous": "上一页",
                    "next":     "下一页",
                    "last":     "末页"
                }
            },
            "processing" : true,
            "serverSide" : true,
            "ordering":false,
            "ajax" : {
                "url":argBusExcepUrl,
                "type":"POST"
            },
            "columns" : tablecolumns(entBusExcepInfoColumns),
            "columnDefs" : [{
                "targets" : [2,5],
                "render":function(data){
                    var javascriptDate = convertDate(data);
                    return "<tr>"+javascriptDate+"</tr>";
                }
            },
                {
                    "targets" : 1,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalIn', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalInAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalIn', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },
                {
                    "targets" : 4,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalOut', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalOutAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalOut', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },{
                    "targets" : [0],
                    "render":function(data, x, obj, index, y){
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
    } else if(result == 18){
        //警示信息中 经营异常ent_bus_excep
        var argBranchBusExcepInfo = $("#needPaging_abnormal").DataTable({
            /*"initComplete": function(settings, json) {
                num++;
                if(num == totalTablesCount){
                    if(tab == "excep_tab"){
                        window.location.href='#excep_tab';
                    }
                    if(tab == "ill_tab"){
                        window.location.href='#ill_tab';
                    }
                }
            },*/
            "bAutoWidth": false,
            "pagingType":   "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无列入经营异常名录信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first":    "首页",
                    "previous": "上一页",
                    "next":     "下一页",
                    "last":     "末页"
                }
            },
            "processing" : true,
            "serverSide" : true,
            "ordering":false,
            "ajax" : {
                "url":argBranchBusExcepUrl,
                "type":"POST"
            },
            "columns" : tablecolumns(entBusExcepInfoColumns),
            "columnDefs" : [{
                "targets" : [2,5],
                "render":function(data){
                    var javascriptDate = convertDate(data);
                    return "<tr>"+javascriptDate+"</tr>";
                }
            },
                {
                    "targets" : 1,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalIn', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalInAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalIn', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },
                {
                    "targets" : 4,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalOut', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalOutAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalOut', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },{
                    "targets" : [0],
                    "render":function(data, x, obj, index, y){
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
    } else {
        //警示信息中 经营异常ent_bus_excep
        var entBusExcepInfo = $("#needPaging_abnormal").DataTable({
            /*"initComplete": function(settings, json) {
                num++;
                if(num == totalTablesCount){
                    if(tab == "excep_tab"){
                        window.location.href='#excep_tab';
                    }
                    if(tab == "ill_tab"){
                        window.location.href='#ill_tab';
                    }
                }
            },*/
            "bAutoWidth": false,
            "pagingType":   "full_numbers",
            "language": {
                "processing": "正在加载，请稍后",
                "lengthMenu": "显示 _MENU_ 项结果",
                "zeroRecords": "暂无列入经营异常名录信息",
                "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
                "infoEmpty": "共 查询到 0 条记录    共 0 页",
                "infoFiltered": "(由 _MAX_ 项结果过滤)",
                "infoPostFix": "",
                "url": "",
                "paginate": {
                    "first":    "首页",
                    "previous": "上一页",
                    "next":     "下一页",
                    "last":     "末页"
                }
            },
            "processing" : true,
            "serverSide" : true,
            "ordering":false,
            "ajax" : {
                "url":entBusExcepUrl,
                "type":"POST"
            },
            "columns" : tablecolumns(entBusExcepInfoColumns),
            "columnDefs" : [{
                "targets" : [2,5],
                "render":function(data){
                    var javascriptDate = convertDate(data);
                    return "<tr>"+javascriptDate+"</tr>";
                }
            },
                {
                    "targets" : 1,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalIn', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalInAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalIn', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalInSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },
                {
                    "targets" : 4,
                    "render":function(data, x, obj, index){
                        if (data.length > 30) {
                            var dataNew = data;
                            dataNew = dataNew.substring(0,30) + "...";
                            var subDiv = "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+dataNew+"</span> <a href=\"javascript:void(0);\" onClick=\"showAllData('abnormalOut', " + index.row + ")\">更多</a></div>";
                            var allDiv = "<div id=\"abnormalOutAllData" + index.row + "\" style=\"display:none;\"><span title='"+data+"'>"+data+"</span> <a href=\"javascript:void(0);\" onClick=\"showSubData('abnormalOut', " + index.row + ")\">收起</a></div>";
                            return subDiv + allDiv;
                        } else {
                            return "<div id=\"abnormalOutSubData" + index.row + "\"><span title='"+data+"'>"+data+"</span></div>"
                        }
                    }
                },{
                    "targets" : [0],
                    "render":function(data, x, obj, index, y){
                        return index.row + index.settings._iDisplayStart + 1;
                    }
                }]
        });
    }
}

function showIllInfo(){
    // 警示信息中 严重违法信息ILL_INFO
    var illInfoColumns = [
        "type",
        "abntime",
        "serILLRea_CN",
        "abntime",
        "decOrg_CN",
        "remExcpRes_CN",
        "remDate",
        "reDecOrg_CN"
    ]
    // 警示信息中 严重违法信息ILL_INFO
    var illInfo = $("#needPaging_illegal").DataTable({
        /*"initComplete": function(settings, json) {
            num++;
            if(num == totalTablesCount){
                if(tab == "excep_tab"){
                    window.location.href='#excep_tab';
                }
                if(tab == "ill_tab"){
                    window.location.href='#ill_tab';
                }
            }
        },*/
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无列入严重违法失信企业名单（黑名单）信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "serverSide" : true,
        "ordering":false,
        "ajax" : {
            "url":IllInfoUrl,
            "type":"POST"
        },
        "columns" : tablecolumns(illInfoColumns),
        "columnDefs" : [{
            "targets" : [3,6],
            "render":function(data){
                var javascriptDate = convertDate(data);
                return "<tr>"+javascriptDate+"</tr>";
            }
        },{
            "targets" : [1],
            "render":function(data){
                return "严重违法失信企业名单";
            }
        },{
            "targets" : [0],
            "render":function(data, x, obj, index, y){
                return index.row + index.settings._iDisplayStart + 1;
            }
        }
        ]
    });
}

function showCheckInfo(){
    // 警示信息中  检查抽查 SPOT_CHECK_INFO
    var spotCheckInfoColumns = [
        "insType",
        "insAuth_CN",
        "insType_CN",
        "insDate",
        "insRes_CN"
    ]
    // 警示信息中  检查抽查 SPOT_CHECK_INFO
    var spotCheckInfo = $("#needPaging_inspect").DataTable({
        /*"initComplete": function(settings, json) {
            num++;
            if(num == totalTablesCount){
                if(tab == "excep_tab"){
                    window.location.href='#excep_tab';
                }
                if(tab == "ill_tab"){
                    window.location.href='#ill_tab';
                }
            }
        },*/
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无抽查检查结果信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "serverSide" : true,
        "ordering":false,
        "ajax" : {
            "url":spotCheckInfoUrl,
            "type":"POST",
            "error":function(){
                now_sec = 'assist';
            }
        },
        "columns" : tablecolumns(spotCheckInfoColumns),
        "fnDrawCallback":function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('assist');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'assist';
            }
        },
        "columnDefs" : [
            {
                "targets" : 2,
                "render":function(data,type,row){
                    if(row.insType == "1"){
                        return "抽查";
                    }else if(row.insType == "2"){
                        return "检查";
                    }
                }
            },
            {
                "targets" : 3,
                "render":function(data){
                    var javascriptDate = convertDate(data);
                    return "<tr>"+javascriptDate+"</tr>";
                }
            },{
                "targets" : [0],
                "render":function(data, x, obj, index, y){
                    return index.row + index.settings._iDisplayStart + 1;
                }
            }
        ]
    });
}

function showStockInfo(){
    //股权出质登记信息
   /* $.ajax({
        url : stakQualitInfoUrl,
        success : function(data){
            if(data.totalPage > 2){
                 $("#stackInfoAll").append("<a href='"+StakqualitAllUrl+"' target='_blank'>" +
                     "查看全部 &gt;&gt;</a>");
             }
        }
    })*/
	pledgeList = new Array();
    var stakQualitInfo = $("#needPaging_pledge").DataTable({
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无股权出质登记信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "ordering":false,
        "serverSide" : true,
        "ajax" : {
            "url":stakQualitInfoUrl,
            "type":"POST",
            "error":function(){
                now_sec = 'copyright';
            }
        },
        "columns" : [{"class":"nopadding"}],
        "fnDrawCallback":function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('copyright');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'copyright';
            }
        },
        "columnDefs" : [
            {
                "targets":0,
                "width":1055,
                "render": function(data,type,row,index){
                	pledgeList[index.row] = row;
                    var equPleDate = convertDate(row.equPleDate);
                    var publicDate = convertDate(row.publicDate);
                    if(row.impAm==null){
                    	row.impAm = "";
                    }                   
                    var type = "";
                    if(row.type == "1"){
                        type = "有效";
                    }else if(row.type == "2"){
                        type = "无效";
                    }
                    var pledAmUnit = "";
                    if(row.pledAmUnit == "1"){
                    	pledAmUnit = "万元";
                    }else if(row.pledAmUnit == "2"){
                    	pledAmUnit = "万股";
                    }
                    if ( row.pledBLicNo == ""){
                        var retStr = "<td><div  class='specialtd'><table frame='void' rules='rows' width='100%'><tr width='100%'>" +
	                        "<td width='6%'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>" +
	                        "<td width='8%'>" + row.equityNo + "</td>" +
	                        "<td width='12%'>" + row.pledgor + "</td>" +
	                        "<td width='10%'>" + "非公示项" + "</td>" +
	                        "<td width='10%'>" + row.impAm + pledAmUnit + "</td>" +
	                        "<td width='12%'>" + row.impOrg + "</td>" +
	                        "<td width='10%'>" + row.impOrgBLicNo + "</td>" +
	                        "<td width='10%'>" + equPleDate + "</td>" +
	                        "<td width='6%'>" + type + "</td>" +
	                        "<td width='10%'>" + publicDate + "</td>" +
	                        "<td width='10%'></td>" +
	                        "</tr>";
                    } else {
	                    var retStr = "<td><div  class='specialtd'><table frame='void' rules='rows' width='100%'><tr width='100%'>" +
	                        "<td width='6%'>"+(index.row + index.settings._iDisplayStart + 1)+"</td>" +
	                        "<td width='8%'>" + row.equityNo + "</td>" +
	                        "<td width='12%'>" + row.pledgor + "</td>" +
	                        "<td width='10%'>" + row.pledBLicNo + "</td>" +
	                        "<td width='10%'>" + row.impAm + pledAmUnit +  "</td>" +
	                        "<td width='12%'>" + row.impOrg + "</td>" +
	                        "<td width='10%'>" + row.impOrgBLicNo + "</td>" +
	                        "<td width='10%'>" + equPleDate + "</td>" +
	                        "<td width='6%'>" + type + "</td>" +
	                        "<td width='10%'>" + publicDate + "</td>" +
	                        "<td width='10%'><span class='clickToDetail' onclick=pledgeDetail(" + index.row + ")>查看</span></td>" +
	                        "</tr>";
                    }
//                    if (row.vStakQualitInfoAlt.length > 0) {
//                        for (var i=0;i<row.vStakQualitInfoAlt.length;i++) {
//                            var altDate = convertDate(row.vStakQualitInfoAlt[i].altDate)
//                            if (i == 0) {
//                                retStr = retStr + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '9' style='color:#F92220'>";
//                                retStr = retStr + "有变更情形 : " + (i + 1) + "、" + altDate + row.vStakQualitInfoAlt[i].alt;
//                                retStr = retStr + "</tr>";
//                            } else {
//                                retStr = retStr + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '9' style='color:#F92220'>";
//                                retStr = retStr + "&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" + (i + 1) + "、" + altDate + row.vStakQualitInfoAlt[i].alt;
//                                retStr = retStr + "</tr>";
//                            }
//                        }
//                        retStr = retStr + "</td></tr>";
//                    }
//                    if (row.type == "2") {
//                        var isCancel = false;
//                        if (row.cancelDate != null || (row.cancelRea != null && row.cancelRea != '')) {
//                            isCancel = true;
//                            var cancelDate = convertDate(row.cancelDate);
//                            retStr = retStr + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '9' style='color:#F92220'>有无效情形 : " + cancelDate + row.cancelRea + "</td></tr>";
//                        }
//                        if (row.canDate != null || (row.equpleCanRea != null && row.equpleCanRea != '')) {
//                            var canDate = convertDate(row.canDate);
//                            if (!isCancel) {
//                                retStr = retStr + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '9' style='color:#F92220'>有无效情形 : " + canDate + row.equPleCanRea + "</td></tr>";
//                            } else {
//                                retStr = retStr + "<tr><td class='feiwuClass' ></td><td class= 'testClass' colspan = '9' style='color:#F92220'>&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp" + canDate + row.equpleCanRea + "</td></tr>";
//                            }
//                        }
//
//                    }
                    retStr = retStr + "</table></div><td>";
                    return retStr;
                }
            }
        ]
    });
}

function showMortInfo(){

    var mortRegInfoColumns = [
        "morRegCNo",
        "morRegCNo",
        "regiDate",
        "regOrg_CN",
        "priClaSecAm",
        "type_CN",
        "publicDate",
        "morReg_Id"
    ]

    //动产抵押登记信息
    /*$.ajax({
        url : mortRegInfoUrl,
        success : function(data){
/*            if(data.totalPage > 2){
                $("#mortregInfoAll").append("<a href='"+MortregAllUrl+"' target='_blank'>" +
                    "查看全部 &gt;&gt;</a>");
            }
        }
    })*/
    var mortRegInfo = $("#needPaging_guaranty").DataTable({
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无动产抵押登记信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "ordering":false,
        "serverSide" : true,
        "ajax" : {
            "url":mortRegInfoUrl,
            "type":"POST",
            "error":function(){
                now_sec = 'stock';
            }
        },
        "columns" : tablecolumns(mortRegInfoColumns),
        "fnDrawCallback":function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('stock');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'stock';
            }
        },
        "columnDefs" : [{
            "targets" : [2,6],
            "render":function(data){
                var javascriptDate = convertDate(data);
                return "<tr>"+javascriptDate+"</tr>";
            }
        },{
            "targets":5,
            "render":function(data,type,row){
                if(row.type == "2"){
                    return "无效";
                }else if(row.type == "1"){
                    return "有效";
                }else{
                    return '';
                }
            }
        },
            {
                "targets":7,
                "render":function(data,type,row){
                    if(row.type == "2"){
                        return '<span class="clickToDetail" onclick="mortRegDetail(\''+row.morReg_Id+'\',\''+row.morRegCNo+'\','+row.regiDate+',\''+row.regOrg_CN+'\')">查看</span>';
                    }
                    if(row.type == "1"){
                        return '<span class="clickToDetail" onclick="mortRegDetail2(\''+row.morReg_Id+'\',\''+row.morRegCNo+'\','+row.regiDate+',\''+row.regOrg_CN+'\')">查看</span>';
                    }
                }
            },{
                "targets" : [0],
                "render":function(data, x, obj, index, y){
                    return index.row + index.settings._iDisplayStart + 1;
                }
            },{
                "targets" : [4],
                "render":function(data,type,row){
                    if(isNaN(row.priClaSecAm)) return '';
                    return row.priClaSecAm+"万"+row.regCapCur_Cn||'';
                }
            }
        ]
    });

}

function showAssistInfo(){

    var judiciaryStockfreezeInfoColumns = [
        "inv",
        "inv",
        "froAm",
        "froAuth",
        "executeNo",
        "type",
        "parent_Id",
        "altId"
    ];

    var judiciaryStockfreezeInfo = $("#needPaging_freeze").DataTable({
        "bAutoWidth": false,
        "pagingType":   "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无司法协助信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first":    "首页",
                "previous": "上一页",
                "next":     "下一页",
                "last":     "末页"
            }
        },
        "processing" : true,
        "serverSide" : true,
        "ordering":false,
        "ajax" : {
            "url":assistUrl,
            "type":"POST",
            "error":function(){
                now_sec = 'annualreport';
            }
        },
        "columns" : tablecolumns(judiciaryStockfreezeInfoColumns),
        "fnDrawCallback":function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('annualreport');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'annualreport';
            }
        },
        "columnDefs" : [{
            "targets" : 6,
            "render":function(data,type,row){
                if(row.type == "1"){
                    return "<span class='clickToDetail' onclick=freezeDetail('"+$.trim(row.parent_Id)+"')>查看</span>"
                } else {
                    return "<span class='clickToDetail' onclick=shareHolderAltDetail("+"'"+$.trim(row.altId)+"'"+")>查看</span>";
                }
            }
        },{
            "targets":7,
            "visible":false
        },{
            "targets" : 5,
            "render":function(data,type,row){
                if(row.type == "1"){
                    if(row.frozState =="1"){
                        return "<span >股权冻结|冻结</span>";
                    }else if(row.frozState == "2"){
                        return "<span >股权冻结|解除冻结</span>";
                    }else if(row.frozState == "3"){
                        return "<span >股权冻结|失效</span>";
                    }
                } else {
                    return "<span >股权变更</span>";
                }
            }
        },{
            "targets" : [0],
            "render":function(data, x, obj, index, y){
                return index.row + index.settings._iDisplayStart + 1;
            }
        },{
            "targets" : [2],
            "render":function(data,type,row){
        	     if(row.froAm==null||row.froAm==''){
        	    	 return "";
        	     }else{
        	    	 return row.froAm + "万" + row.regCapCur_CN;
        	     }              
            }
        }
        ]
    });
}

	function showAnnualList(){
	    $('.annual-tishi').show();
	    $.ajax({
	        type: "GET",
	        url: anCheYearInfo,
	        success: function(data){
	    	    if(!data || typeof data =="string"){
	    	    	$("#annual_menu_table").remove();
	                $('#annual_menu').append("<tr class='odd'><td  style='background:#F3F7FA;width:1077px;color:#666;' id='dataTables_empty' colspan='4'></td></tr>");
	                return;
	    	    }
	            if(!data.length){
	                $("#annual_menu_table").remove();
	                $('#annual_menu').append("<tr class='odd'><td  style='background:#F3F7FA;width:1077px;color:#666;' id='dataTables_empty' colspan='4'>暂无企业年报信息</td></tr>");
	                return;
	            }else{
	            	var html = "";
	                for(var i = data.length,length=data.length;i>0;i--){           	
	                    var _index = length - i +1;
	                    
	                    if(data[i-1].annRepFrom == '2' && $("#entType").val() == '16') {
	                        html += "<tr><td>" + _index + "</td>" + "<td>" + data[i - 1].anCheYear + "年度报告</td>" + "<td>" + convertDate(data[i - 1].anCheDate) + "</td>" + "<td>" + "<a class='clickToDetail'>已上报纸质年报</a>" + "</td><td style='display:none'>" + data[i - 1].anCheId + "</td></tr>";
	                    } else {
	                        html += "<tr><td>" + _index + "</td>" + "<td>" + data[i - 1].anCheYear + "年度报告</td>" + "<td>" + convertDate(data[i - 1].anCheDate) + "</td>" + "<td onclick='jumpToAnnualDetail(this)'>" + "<a class='clickToDetail'>查看</a>" + "</td><td style='display:none'>" + data[i - 1].anCheId + "</td></tr>";
	                    }
	                }
	                $("#annual_menu_table tbody").append(html);
	
	                n_h = $('#footer_ac').offset().top;
	                s_t = getbodyST();
	                if(n_h<s_t+more_h){
	                    addNext('instant');
	                }else{
	                    !isLoaded['all'] && $('#addmore').show();
	                }
	            }
	            
	        },
	        error:function(){
	            n_h = $('#footer_ac').offset().top;
	            s_t = getbodyST();
	            if(n_h<s_t+more_h){
	                addNext('instant');
	            }else{
	                !isLoaded['all'] && $('#addmore').show();
	                now_sec = 'instant';
	            }
	        }
	
	    });
	}

function showTrademark(){
    $.ajax({
        type: "GET",
        url: trademarkInfoUrl,
        success: function (data) {

            if(data.recordsTotal == 0){
                $('.trademark-list').html('<tr class="odd"><td style="background:#F3F7FA;color:#666" width="1077px" id="dataTables_empty" colspan="4">暂无商标注册信息</td></tr>');
            } else {
                if(data.recordsTotal > 4){
                    $('#trademarkCount').html("共计"+data.recordsTotal+"条信息");
                    $('#trademarkCount').append("<a href='" + allTrademarkUrl + "' target='_blank'><<查看全部>></a>");
                }
                var length = data.data.length;
                for(var i=0; i<length; i++){
                    var javascriptDate = convertDate(data.data[i].regAnncDate);
                    var tmImage = "/doc/" + data.data[i].nodeNum + "/tmfiles/" + data.data[i].tmImage;
                    $('#trademark-list').append(
                        "<li>" +
                            "<div>" +
                            "<img src="+tmImage+" onerror='imgerror(this)' style=\"max-width:200px\"/>" +
                                "<div class='markInfo_container'>" +
                                    "<div class='markInfo_item'><span>商标注册号：</span><span>"+data.data[i].regNum+"</span></div>" +
                                    "<div class='markInfo_item'><span>类别：</span><span>"+data.data[i].intCls+"</span></div>" +
                                    "<div class='markInfo_item'><span>注册公告日期：</span><span>"+javascriptDate+"</span></div>" +
                                    "<div class='markInfo_item xiangqing'><a href='" + tradeMarkDetailUrl +"?tmid="+data.data[i].tmId+ "' target='_blank' style='color:#ff9831'><<查看详情>></a></div>" +
                                "</div>" +
                            "</div>" +
                        "</li>"
                    );
                }
            }

            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('check');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'check';
            }
        },
        error:function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('check');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'check';
            }
        }

    });
}


function showCopyright(){
    // 知识产权出质登记信息
    var insProPledgeRegInfoColumns = [
        "pleId",
        "tmRegNo",
        "tmName",
        "kinds",
        "pledgor",
        "impOrg",
        "pleRegPerTo",
        "type",
        "publicDate",
        "canDate",
        "equPleCanRea",
        "invalidDate",
        "invalidRea"
    ]
    var insProPledgeRegInfo = $("#copyright_baseinfo").DataTable({
        "bAutoWidth": false,
        "pagingType": "full_numbers",
        "language": {
            "processing": "正在加载，请稍后",
            "lengthMenu": "显示 _MENU_ 项结果",
            "zeroRecords": "暂无知识产权出质登记信息",
            "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
            "infoEmpty": "共 查询到 0 条记录    共 0 页",
            "infoFiltered": "(由 _MAX_ 项结果过滤)",
            "infoPostFix": "",
            "url": "",
            "paginate": {
                "first": "首页",
                "previous": "上一页",
                "next": "下一页",
                "last": "末页"
            }
        },
        "processing": true,
        "serverSide": true,
        "ordering": false,
        "ajax": {
            "url": proPledgeRegInfoUrl,
            "type": "POST",
            "error":function(){
                now_sec = 'trademark';
            }
        },
        "columns": tablecolumns(insProPledgeRegInfoColumns),
        "fnDrawCallback":function(){
            n_h = $('#footer_ac').offset().top;
            s_t = getbodyST();
            if(n_h<s_t+more_h){
                addNext('trademark');
            }else{
                !isLoaded['all'] && $('#addmore').show();
                now_sec = 'trademark';
            }
        },
        "columnDefs": [{
            "targets": [8],
            "render": function (data) {
                var javascriptDate = convertDate(data);
                return "<tr>" + javascriptDate + "</tr>";
            }
        },
            {
                "targets": [6],
                "render": function (data, type, row) {
                    var javascriptDate = convertDate(row.pleRegPerFrom);
                    var javascriptDate2 = convertDate(row.pleRegPerTo)
                    return "<tr>" + javascriptDate + "至" + javascriptDate2 + "</tr>";
                }
            }
            , {
                "targets": 9,
                "render": function (data, type, row) {
                    if (row.type == 1) {
                        if (row.vInsAlterintelpropledgeinfoList.length != 0) {
                            return "<span class='clickToDetail' onclick=insIntellectualDetail(" + "'"
                                + row.pleId + "'" + "," + "'" + row.type + "'" + "," + "'" + row.canDate + "'"
                                + "," + "'" + row.equPleCanRea + "'" + "," + "'"
                                + row.invalidDate + "'" + "," + "'" + row.invalidRea + "'" + ")>查看</span>";
                        } else {
                            return "";
                        }
                    } else {
                        return "<span class='clickToDetail' onclick=insIntellectualDetail(" + "'"
                            + row.pleId + "'" + "," + "'" + row.type + "'" + "," + "'" + row.canDate + "'"
                            + "," + "'" + row.equPleCanRea + "'" + "," + "'"
                            + row.invalidDate + "'" + "," + "'" + row.invalidRea + "'" + ")>查看</span>";
                    }
                }
            }, {
                "targets": [10, 11, 12],
                "visible": false
            }, {
                "targets": 7,
                "render": function (data) {
                    if (data == 1) {
                        return "有效";
                    } else {
                        return "无效";
                    }
                }
            },
            {
                "targets": 3,
                "render": function (data) {
                    if (data == 1) {
                        return "商标";
                    } else if (data == 2) {
                        return "知识产权";
                    } else {
                        return "其他";
                    }
                }
            }, {
                "targets": [0],
                "render": function (data, x, obj, index, y) {
                    return index.row + index.settings._iDisplayStart + 1;
                }
            }
        ]
    });
}

function showSimpleCancer() {
    //简易注销公告信息
    $.ajax({
        url: simpleCancelUrl,
        success: function (data) {
    	    var str ="";
            if (data == null||data.noticeFrom==null||data.noticeTo==null) {               
                str+='<div style="width:463px;height:118px;font-style:normal;font-weight: 400;color: #ccc; display:inline-block;border:1px solid #ccc;background-color: #f7f8fa;margin-bottom: 30px;">'+
                		'<div style="font-size:14px;color:#333333;line-height: 28px;left: 157px;margin-left: 120px;margin-top: 40px;">'
                   + '暂无简易注销公告信息' + '</div></div>';
               $('#simpleCancelForAll').html(str);   
            }else{
            	var noticeFrom = convertDate(data.noticeFrom);
                var noticeTo = convertDate(data.noticeTo);
                    
                    var str1 = "";
                    var str2 = "";
                    if (data.entName != null && data.entName != "" && data.entName.length > 0) {
                    	str1 += data.entName+'简易注销公告信息';
                    	str2 = str1; 
                        if (str1.length > 30) {
                            str1 = str1.substring(0, 30);
                            str1 += "...";
                        } 
                    }               
                    str+='<div style="width:463px;height:118px;font-style:normal;font-weight: 400;color: #ccc; display:inline-block;border:1px solid #ccc;background-color: #f7f8fa;margin-bottom: 30px;">'+
                    		'<div style="font-size:14px;color:#333333;line-height: 28px;left: 157px;margin-left: 20px;margin-top: 10px;" title="' + str2+ '">'
                       + str1 + '</div><span style="font-size:14px;color:#666666;left: 157px;line-height: 28px;margin-left: 20px;">公告期：'+noticeFrom+' - '+noticeTo+'</span><div style="color: #FF962D;left:157px;line-height: 28px;margin-left: 20px;">'
                    
                    var subsite = $("#subsites").val();
                	var prip = $("#prip").val();
                	var scId = $("#scId").val();
                	if(subsite=="120000"){
                	  str+= '<a style="color:#FF962D;" href="' + 'http://tjxy.gov.cn/gjgsxt/notice/openDetailPage?infoType=12&entId='+prip+'&id='+scId+'" ><<查看详情>>'+'</a></div></div>';  
                	}else{
                	  str+= '<a style="color:#FF962D;" target="_blank" href="' + toSimpleCancelInfoAndObjectionUrl+'" ><<查看详情>>'+'</a></div></div>';  	
                	}
                                                                         
                $('#simpleCancelForAll').html(str);
            }           
        },        
    });
}
//跳转年报详情入口
function jumpToAnnualDetail(t){
    var year = parseInt($(t).prev().prev().html());
    var entType = $('#entType').val();
    var anCheId = $(t).next().html();
    var url = annRepDetailUrl + '?anCheId='+anCheId+'&entType='+entType+'&anCheYear='+year;
    window.open(url);
}

var isLoaded ={};//是否加载某项详情的标识

var jinshiflag = true;

var n_h = 0;
var itsItem = {};
var now_sec = '';
var more_h = 400;

function getbodyST(){
    var c_h = window.screen.availHeight;
    var s_t = $(window).scrollTop();
    return c_h+s_t;
}

function addNext(n){
    switch(n){
        case 'keyperson':{
            if(!isLoaded['keyperson'] && itsItem['keyperson']){
                isLoaded['keyperson'] = true;
                showKeyPerson();
                $('#wrap-keyperson').show();
            }else{
                addNext('branch');
            }
            break;
        }
        case 'branch':{
            if(!isLoaded['branch'] && itsItem['branch']){
                isLoaded['branch'] = true;
                showBranch();
                $('#wrap-branch').show();
            }else{
                addNext('clear');
            }
            break;
        }
        case 'clear':{
            if(!isLoaded['clear'] && itsItem['clear']){
                isLoaded['clear'] = true;
                showClearingInfo();
                $('#wrap-clear').show();
            }else{
                addNext('alter');
            }
            break;
        }
        case 'alter':{
            if(!isLoaded['alter'] && itsItem['alter']){
                isLoaded['alter'] = true;
                showAlterInfo(entType);
                $('#wrap-alter').show();
            }else{
                addNext('mort');
            }
            break;
        }
        case 'mort':{
            if(!isLoaded['mort'] && itsItem['mort']){
                isLoaded['mort'] = true;
                showMortInfo();
                $('#wrap-mort').show();
            }else{
                addNext('stock');
            }
            break;
        }
        case 'stock':{
            if(!isLoaded['stock'] && itsItem['stock']){
                isLoaded['stock'] = true;
                showStockInfo();
                $('#wrap-stock').show();
            }else{
                addNext('copyright');
            }
            break;
        }
        case 'copyright':{
            if(!isLoaded['copyright'] && itsItem['copyright']){
                isLoaded['copyright'] = true;
                showCopyright();
                $('#wrap-copyright').show();
            }else{
                addNext('trademark');
            }
            break;
        }
        case 'trademark':{
            if(!isLoaded['trademark'] && itsItem['trademark']){
                isLoaded['trademark'] = true;
                showTrademark();
                $('#wrap-trademark').show();
            }else{
                addNext('check');
            }
            break;
        }
        case 'check':{
            if(!isLoaded['check'] && itsItem['check']){
                isLoaded['check'] = true;
                showCheckInfo();
                $('#wrap-check').show();
                $('#wrap-drranins').show();
            }else{
                addNext('assist');
            }
            break;
        }
        case 'assist':{
            if(!isLoaded['assist'] && itsItem['assist']){
                isLoaded['assist'] = true;
                showAssistInfo();
                $('#wrap-assist').show();
            }else{
                addNext('annualreport');
            }

            break;
        }
        case 'annualreport':{
            $('.annual-tishi').show();
            if(!isLoaded['annualreport'] && itsItem['annualreport']){
                isLoaded['annualreport'] = true;
                showAnnualList();
                $('#wrap-annualreport').show();
            }else{
                addNext('instant');
            }
            break;
        }
        case 'instant':{
            if(!isLoaded['instant'] && itsItem['instant']){
                isLoaded['instant'] = true;
                showInstantInfo();
                $('#wrap-instant').show();
            }else{
            	addNext('simplecancer');
            }
            //$('#addmore').hide();
            break;
        }
        case 'simplecancer':{
            if(!isLoaded['simplecancer'] && itsItem['simplecancer']){
                isLoaded['simplecancer'] = true;
                showSimpleCancer();
                $('#wrap-simplecancer').show();
            }
            $('#addmore').hide();
            break;
        }
    }
}

$(document).ready(function () {
    choosetab();//切换tab逻辑
    entType = document.getElementById("entType").value;

    //直接加载营业执照信息
    itsItem = entTypeToLab[entType];
    if(entType==18){
        $('.annual-tishi').remove();
        $('.biaoshi').remove();
        jinshiflag = false;
    }
    if(itsItem['ill']) $('#tab_primary5').show();
    var newTab = $('#newTab').val();
    if(newTab=='' || newTab=='all' || newTab=='ent_tab'){
    	 $('.menu span').eq(0).addClass('active');
    	    getMsg(1);
            n_h = $('#footer_ac').offset().top;
    }
    if(newTab=='excep_tab'){
    	 $('.menu span').eq(3).addClass('active');
 	    getMsg(4);
    }
    if(newTab=='ill_tab'){
   	 $('.menu span').eq(4).addClass('active');
	    getMsg(5);
   }      
    addEventToTop();
    
    $('.pop-close,.bgPop').click(function () {
        $('.bgPop,.pop').hide();
    });    
});

//tab切换逻辑
function choosetab(){
    $('.menu span').on('click',function(){
        $('.menu span').removeClass('active');
        $(this).addClass('active');
        var id=$(this).attr('id').substr(11);
        getMsg(id);
    })
}

function addOther(){
    isLoaded['all'] = true;
    $('#addmore').hide();

    if(!isLoaded['keyperson'] && itsItem['keyperson']){
        isLoaded['keyperson'] = true;
        showKeyPerson();
        $('#wrap-keyperson').show();
    }

    if(!isLoaded['branch'] && itsItem['branch']){
        isLoaded['branch'] = true;
        showBranch();
        $('#wrap-branch').show();
    }

    if(!isLoaded['clear'] && itsItem['clear']){
        isLoaded['clear'] = true;
        showClearingInfo();
        $('#wrap-clear').show();
    }

    if(!isLoaded['alter'] && itsItem['alter']){
        isLoaded['alter'] = true;
        showAlterInfo(entType);
        $('#wrap-alter').show();
    }

    if(!isLoaded['mort'] && itsItem['mort']){
        isLoaded['mort'] = true;
        showMortInfo();
        $('#wrap-mort').show();
    }

    if(!isLoaded['stock'] && itsItem['stock']){
        isLoaded['stock'] = true;
        showStockInfo();
        $('#wrap-stock').show();
    }

    if(!isLoaded['copyright'] && itsItem['copyright']){
        isLoaded['copyright'] = true;
        showCopyright();
        $('#wrap-copyright').show();
    }

    if(!isLoaded['trademark'] && itsItem['trademark']){
        isLoaded['trademark'] = true;
        showTrademark();
        $('#wrap-trademark').show();
    }

    if(!isLoaded['check'] && itsItem['check']){
        isLoaded['check'] = true;
        showCheckInfo();
        $('#wrap-check').show();
        $('#wrap-drranins').show();
    }

    if(!isLoaded['assist'] && itsItem['assist']){
        isLoaded['assist'] = true;
        showAssistInfo();
        $('#wrap-assist').show();
    }
    $('.annual-tishi').show();
    if(!isLoaded['annualreport'] && itsItem['annualreport']){
        isLoaded['annualreport'] = true;
        showAnnualList();
        $('#wrap-annualreport').show();
    }

    if(!isLoaded['instant'] && itsItem['instant']){
        isLoaded['instant'] = true;
        showInstantInfo();
        $('#wrap-instant').show();
    }
    
    if(!isLoaded['simplecancer'] && itsItem['simplecancer']){
        isLoaded['simplecancer'] = true;
        showSimpleCancer();
        $('#wrap-simplecancer').show();
    }
}

function clickToAddmore(){
	addOther();
}

//获取详情
function getMsg(id){
    id = parseInt(id);
    switch(id){
        case 1:{
            $('.content-i').hide();
            $('#content'+id).show();
            $('#wrap-base').show();
            if(!isLoaded['shareholder'] && itsItem['shareholder']){
                showShareHolder(entType);
                isLoaded['shareholder'] = true;
                $('#wrap-shareholder').show();
            }else{
                addNext('keyperson');
            }
            return;
            if(isLoaded['tab_primary'+id]) return;
            
            if(itsItem['keyperson']){
                showKeyPerson();
                $('#wrap-keyperson').show();
            }
            if(itsItem['branch']){
                showBranch();
                $('#wrap-branch').show();
            }
            if(itsItem['clear']){
                showClearingInfo();
                $('#wrap-clear').show();
            }
            if(itsItem['alter']){
                showAlterInfo(entType);
                $('#wrap-alter').show();
            }
            if(itsItem['mort']){
                showMortInfo();
                $('#wrap-mort').show();
            }
            if(itsItem['stock']){
                showStockInfo();
                $('#wrap-stock').show();
            }
            if(itsItem['check']){
                showCheckInfo();
                $('#wrap-check').show();
                $('#wrap-drranins').show();
            }
            if(itsItem['assist']){
                showAssistInfo();
                $('#wrap-assist').show();
            }
            if(itsItem['annualreport']){
                showAnnualList();
                $('#wrap-annualreport').show();
            }
            if(itsItem['instant']){
                showInstantInfo();
                $('#wrap-instant').show();
            }
            if(itsItem['trademark']){
                showTrademark();
                $('#wrap-trademark').show();
            }
            if(itsItem['copyright']) {
                showCopyright();
                $('#wrap-copyright').show();
            }
            if(itsItem['simplecancer']) {
                showSimpleCancer();
                $('#wrap-simplecancer').show();
            }
            isLoaded['tab_primary'+id] =true;
            break;
        }
        case 2:{
            $('.content-i').hide();
            $('#content'+id).show();
            if(isLoaded['tab_primary'+id]) return;

            showOtherLicInfo();
            $('#wrap-other').show();
            isLoaded['tab_primary'+id] =true;
            break;
        }
        case 3:{
            $('.content-i').hide();
            $('#content'+id).show();
            if(isLoaded['tab_primary'+id]) return;
            
            showPunishInfo();
            $('#wrap-pubish').show();
            isLoaded['tab_primary'+id] =true;
            break;
        }
        case 4:{
            $('.content-i').hide();
            $('#content'+id).show();
            if(isLoaded['tab_primary'+id]) return;
            showOperAbnormalInfo(entType);
            $('#wrap-abnormal').show();
            

            isLoaded['tab_primary'+id] =true;
            break;
        }
        case 5:{
            $('.content-i').hide();
            $('#content'+id).show();
            if(isLoaded['tab_primary'+id]) return;

            showIllInfo();
            $('#wrap-ill').show();
            isLoaded['tab_primary'+id] =true;
            break;
        }
        default:{
            console.log(0);
            break;
        }
    }
}

//年报即时信息警示条逻辑
$(window).scroll(function(){
    if(!jinshiflag) return false;
    var top = $(window).scrollTop();
    if(top>=700){
        $('#back-to-nav-div').show();
    }else{
        //$('.back-to-nav').hide();
    }

    var static_top = $('.biaoshi').offset().top;


    if(top-static_top>=0 && $('#content1').css('display')!=='none'){
        $('.annual-tishi').css({'position':'fixed','top':0});
        $('.biaoshi').height(40);
    }else{
        $('.annual-tishi').css({'position':'','top':0});
        $('.biaoshi').height(1);
    } 

　　

});
$(window).scroll(function(){
	var top = $(window).scrollTop();
	var scrollHeight = $(document).height();
　　var windowHeight = $(this).height();
　　if(top + windowHeight == scrollHeight){
　　　　if(!isLoaded['all']){
            // addOther();
            addNext(now_sec);
        }
　　}
});

//回到导航逻辑
function addEventToTop(){
    var h = $('.menu').offset().top;
    $('#back-to-nav-div').on('click',function(){
    	//consloe.log("成功");
        $('html,body').animate({'scrollTop':h},500,function(){
            //$('.back-to-nav').hide();
        })
    })
}

function cancer_objecton(){
	var subsite = $("#subsites").val();
	var prip = $("#prip").val();
	var scId = $("#scId").val();
	var pripId = $('#pripidForSubcribe').val();
	var entType = $('#entTypeForHistoryScan').val();
	if(subsite=="120000"){
		 $("#cancer_object").attr("href","http://tjxy.gov.cn/gjgsxt/notice/openDetailPage?infoType=12&entId="+prip+"&id="+scId);
	}else{
		//$("#cancer_object").attr("href",toSimpleCancelInfoAndObjectionUrl);
		$.ajax({
	  	    //url:"/corp-query-entprise-info-isLogin.html",
			url:isLoginUrl,
	        type:'POST',
	        success:function(data){
			   if(data.value){
				   cancelObjJump(pripId,entType);
			   }else{
				   showLogin();
			   }
	        },
	   });
	}   
    $("#cancer_object").click();
};	
//added by wg begin
//点击营业执照缩略图，弹出层
function popYyzz() {
//	$('.bgPop,.pop').show();
}
//added by wg end

/*function subcribe(){
	$.ajax({
  	    url:"/corp-query-entprise-info-isLogin.html",
        type:'GET',
        success:function(data){
		   if(data.value){
			   subcribe2();
		   }else{
			   //alert("未登录");
			   showLogin();
		   }
        },
   });
}*/
/*
 * =subcribe
 * 订阅按钮响应函数
 * */
function subcribe(){

//	var pripId = $('#pripidForSubcribe').val();
//	var entType = $('#entTypeForHistoryScan').val();
	$.ajax({
  	    //url:"/corp-query-entprise-info-isLogin.html",
		url:isLoginUrl,
        type:'POST',
        success:function(data){
		   if(data.value){
//			   subcribeCheckUserInfo(pripId,entType);
			   subcribeCheckUserInfo();
		   }else{
			   showLogin();
		   }
        },
   });
}
//点击“异议”
function objection(){
	$.ajax({
		url:isLoginUrl,
        type:'POST',
        success:function(data){
		   if(data.value){
			   objectionCheckUserInfo2();
		   }else{
			   showLogin();
		   }
        },
   });
}

function subcribe2(){
	 var entType = $('#entType').val();
	 var pripId = null;
	 //var pripId = $('#pripidForSubcribe').val();
	 var entName = $('#entNameForSubcribe').val();
	 //alert(entType);
	 $.post(showSubcribeUrl,function(data){			
		 //console.log(data);
		 if((!data)||(!data.data[0])){
			 $("#subcribe_type").val("1");
			 showCheckedModule(entType,'','','',pripId,entName);
		 }else{
			 $("#subcribe_type").val("2");
			 showCheckedModule(entType,data.data[0].moduleList,data.data[0].userId,data.data[0].subsId,pripId,entName);
		 }
	 });
	 
	 document.getElementById("bg").style.display ="block";
	 document.getElementById("subcribe_info").style.display ="block";	
}
/**

 * 替换字符串中的字段.

 * @param {String} str 模版字符串

 * @param {Object} o json data

 * @param {RegExp} [regexp] 匹配字符串的正则表达式

 */

function substitute(str,o,regexp){

  return  str.replace(regexp || /\\?\{([^{}]+)\}/g, function (match, name) {

    return (o[name] === undefined) ? '' : o[name];

  });

}
/**
 * =showCheckedModule
 * 显示订阅模块
 * */
function showCheckedModule(entType,submodules,userId,subsId,pripId,entName){
	 //已经订阅的模块
	 var/*string*/ modules='';
	 //企业模块
	 var /*array*/ modu_ent_a = [{"num":'01',"name":"照面变更信息	"},
		 {"num":'02',"name":"股东变更信息"},
		 {"num":'03',"name":"高管变更信息"},
		 {"num":'04',"name":"行政处罚新增信息"},
		 {"num":'05',"name":"异常名录列入移出信息"},
		 {"num":'06',"name":"严重违法失信企业名单列入移出信息"},
		 {"num":'07',"name":"简易注销公告新增信息"}];
	 //个体户
	 var /*array*/ modu_indi_a = [{"num":'01',"name":"照面变更信息"},
		 {"num":'04',"name":"行政处罚新增信息"},
		 {"num":'05',"name":"异常名录列入移出信息"},
		 {"num":'07',"name":"简易注销公告新增信息"}];
	 var /*number*/ len = -1,//长度
	 	/*number*/i=-1,//位置
	 	/*array*/ label_a = null,//显示标签组合
	 	/*number*/ num = null,//模块号
	 	/*string*/ name = null//模块名
 	 ;
	 var /*string*/ temp = '<label style="width:50%;"><input id="modu_{num}" type="checkbox" name="subsModule" value="{num}" /><span style="padding-bottom:3px;">&nbsp;{name}</span></label>';
	 if(submodules && submodules != null && submodules.length>0)
	{
	 for(var i=0;i<submodules.length;i++){
		 modules += submodules[i];
		 if(i<(submodules.length-1)){
			 modules += ',';
		 }
	 }
	}	 
	 $('#info_entType').val(entType);
	 $('#info_subsId').val(subsId);	
	 $('#info_userId').val(userId);	
	 $('#info_modules').val(modules);
	// $('#info_pripId').val(pripId);
	 $('#info_entName').val(entName);

	 $('label').remove();
	 /*
	 $('#subent').after('<label><input id="sub_baseinfo" type="checkbox" name="subsModule" value="11" />照面信息变更</label>'
             +'<label><input id="sub_shareholder" type="checkbox" name="subsModule" value="12" />股东变更</label>'
             +'<label><input id="sub_keyperson" type="checkbox" name="subsModule" value="14" />高管变更</label>'
             +'<label><input id="sub_simplecancer" type="checkbox" name="subsModule" value="24" />简易注销公告</label>'
             +'<label><input id="sub_punish" type="checkbox" name="subsModule" value="3" />新增行政处罚</label>'
             +'<label><input id="sub_abnormal" type="checkbox" name="subsModule" value="4" />列入经营异常</label>'
             +'<label><input id="sub_illInfo" type="checkbox" name="subsModule" value="5" />列入严重违法</label>');
	*/
	
	if("16" == entType)
	{
		label_a = [];
		len = modu_indi_a.length;
		for(i = 0;i<len;i++)
		{
			label_a.push(substitute(temp,modu_indi_a[i]));
		}
	}
	else
	{
		//企业
		label_a = [];
		len = modu_ent_a.length;
		for(i = 0;i<len;i++)
		{
			label_a.push(substitute(temp,modu_ent_a[i]));
		}
	}
	 $('#subent').after(label_a.join(""));
	 label_a = null;
	 /*if($.inArray('2',submodules)!=-1){
		 $('#sub_other_license').attr("checked",true);
	 }*/	
	 if(submodules && submodules != null && submodules.length>0)
	{
		 if("16" == entType)
		{
			len = modu_indi_a.length;
			for(i = 0;i<len;i++)
			{
				num = modu_indi_a[i]["num"];			
				if($.inArray(num,submodules)!=-1){
					$('#modu_'+num).attr("checked",true);
				 }				
			}
		}
		else
		{			
			len = modu_ent_a.length;
			for(i = 0;i<len;i++)
			{
				num = modu_ent_a[i]["num"];			
				if($.inArray(num,submodules)!=-1){
					$('#modu_'+num).attr("checked",true);
				 }	
			}
		}
	}
	 
}

function quanxuan(){
	var x = document.getElementsByName("subsModule");
	for(var i=0;i<x.length;i++){
		if(document.getElementById("sub_all").checked){
			x[i].checked=true;
		}else{
			x[i].checked=false;
		}
		
	}	
}
/**
 * =updateSubModuleList
 * 提交订阅信息
 * */
function updateSubModuleList(){
	var /*object*/ _doc = document,
		/*string*/ type = null,
		/*string*/ name="subsModule",
		/*array*/ modules = null,
		/*number*/ len = -1,
		/*number*/ i  = -1,
		/*boolean*/ isSele = false,
		/*object*/ temp =null
	;
	type = _doc.getElementById("subcribe_type").value;	
	modules = _doc.getElementsByName(name);
	if(modules && "object" === typeof modules)
	{
		len = modules.length;
		i = len -1;	
		do
		{
			temp = modules[i];
			isSele = temp.checked;
			if(isSele)
			{
				break;
			}
		}
		while(--i>=0);
	}
	if(isSele)
	{
		$("#updateSubModuleList").attr({"disabled":"disabled"});
		$.ajax({
		    cache: true,
		    type: "POST",
		    url:updateSubModulesInfoUrl,
		    dataType: "json",
		    data:$('#formUpdateModule').serialize(),
		    async: true,
		    error: function(request) {
		    	$("#updateSubModuleList").removeAttr("disabled");//将按钮可用
		        alert("Connection error");
		    },
		    success: function(data) {
		    	$("#updateSubModuleList").removeAttr("disabled");//将按钮可用
		    	_doc.getElementById("bg").style.display ="none";
		    	_doc.getElementById('subcribe_info').style.display = 'none';
		    	var /*string*/type = null;
		    	var /*boolean*/ success=data["success"];
		    	var /*string*/ message=data["message"];
		    	if(success)
		    	{
		    		type = _doc.getElementById("subcribe_type").value;	
			    	if("2" === type)
					{
						_doc.getElementById('subcribe_updateSuccess').style.display = 'block';
					}
					else if("1" === type)
					{
						_doc.getElementById('subcribe_addSuccess').style.display = 'block';
					}
		    	}
		    	else
		    	{
		    		_doc.getElementById("tip_message").innerHTML=message;
		    		_doc.getElementById('dinymic_tips').style.display = 'block';		    		
		    	}
		    }
		});		
		 
	}
	else
	{
//		alert("请至少选择一个订阅模块！");
		_doc.getElementById('subcribe_tips').style.display = 'block';
		
	}
	
}

//用户点击进入详情页后添加历史浏览记录
$(function(){
	var pripId = $('#pripidForSubcribe').val();
	var entType = $('#entTypeForHistoryScan').val();
	$.ajax({
  	    //url:"/corp-query-entprise-info-addNewHistoryScan-"+pripId+".html?entType="+entType,
		url:addNewHistoryScanUrl,
        type:'GET',
        success:function(data){
        },
        error:function(){
        }
   });
});

function updateSuccess(){
	 document.getElementById('subcribe_updateSuccess').style.display = 'none'; 
	 document.getElementById('bg').style.display ='none'; 
}

//点击滚动条的“异议”按钮时，校验个人信息是否完善
function objectionCheckUserInfo(pripId,entType){
	var jumpToObjectionUrl = $('#jumpToObjectionUrl').val();
	$.ajax({
  	    //url:"/corp-query-entprise-info-checkUserInfo.html",
		url:checkUserInfoUrl,
        type:'GET',
        success:function(data){
		   if(data.value){
			   var result = $('#attention-this').serialize();  //获取值. 
			   var pripid=$("#attention-pripid").val();
			   //window.open("/userinfo-Submit-Objection.html?vsubmitobejctionentbase="+result+"&pripid="+pripid); 
			   window.open("/corp-query-entprise-info-Submit-Objection-"+pripid+".html?vsubmitobejctionentbase="+result);
		   }else{
			    document.getElementById("bg").style.display ="block";
				document.getElementById("updateObjectionMessage").style.display ="block";
		   }
        },
     });
}

function objectionCheckUserInfo2(){
	var jumpToObjectionUrl = $('#jumpToObjectionUrl').val();
	$.ajax({
		url:checkUserInfoUrl,
        type:'POST',
        success:function(data){
		   if(data.value){
			   //window.open(jumpToObjectionUrl);
			   var a = document.getElementById('objection');
		   	   a.setAttribute('href', jumpToObjectionUrl);  
	           a.setAttribute('target', 'view_window');
	           //a.setAttribute('target', '_blank');
	           a.click();
		   }else{
			    document.getElementById("bg").style.display ="block";
				document.getElementById("updateObjectionMessage").style.display ="block";
		   }
        },
     });
}

//跳转到用户管理中心的设置菜单，完善个人信息
function jumpToUserInfo(){
	 window.location.href = "/corp-query-entprise-info-loadUserInfo.html";
}

//点击滚动条的“订阅”按钮时，校验个人信息是否完善
function subcribeCheckUserInfo(){
	$.ajax({
		url:checkUserInfoUrl,
        type:'POST',
        success:function(data){
		   if(data.value){
			   subcribe2();
		   }else{
			    document.getElementById("bg").style.display ="block";
				document.getElementById("updateSubcribeMessage").style.display ="block";
		   }
        },
     });
}
//点击企业详情页的“简易注销异议”按钮时，校验个人信息是否完善
function cancelObjJump(pripId,entType){
	$.ajax({
  	    //url:"/corp-query-entprise-info-checkUserInfo.html",
		url:checkUserInfoUrl,
        type:'GET',
        success:function(data){
		   if(data.value){
			   //window.location.href = objectionWriteUrl;
			   //window.open(objectionWriteUrl);
			   var a = document.getElementById('cancer_object');
			   a.setAttribute('href', objectionWriteUrl);  
	           a.setAttribute('target', '_blank');
	           /*if(!document.getElementById('cancer_object')) {                       
	                  document.body.appendChild(a);  
	           }*/  
	           a.click();
		   }else{
			    document.getElementById("bg").style.display ="block";
				document.getElementById("updateCancelObjectionMessage").style.display ="block";
		   }
        },
     });
}




//获取双随机分页
$(function showDrRaninsResTable () {

      var drraninsResColumns = ["index",
          "raninsPlanId",
			"raninsPlaneName",
			"raninsTaskId",
			"raninsTaskName",
			"raninsTypeName",
			"insAuth",
			"insDate"
          ];
      drRaninsResTable = $("#drRaninsResTable").DataTable({ 
      	"bAutoWidth": false,
      	"bDestroy" : true,
      	"processing": true,
          "serverSide": true,
          "ordering": false,
          "retrieve": true,
          "iDisplayLength":10,
          "pagingType": "full_numbers",
          "language": {
              "processing": "正在加载，请稍后",
              "lengthMenu": "显示 _MENU_ 项结果",
              "zeroRecords": "暂无双随机抽查结果信息",
              "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
              "infoEmpty": "共 查询到 0 条记录    共 0 页",
              "infoFiltered": "(由 _MAX_ 项结果过滤)",
              "infoPostFix": "",
              "paginate": {
                  "first": "首页",
                  "previous": "上一页",
                  "next": "下一页",
                  "last": "末页"
              }
          },
          "ajax": {
              "url":getDrRaninsResUrl,
              "type": "GET",
              "error":function(){
                  now_sec = 'keyperson';
              }
          },
          "columns": tablecolumns(drraninsResColumns),

          "columnDefs": [ 
               {
                  "targets": [0],
                  "render": function (data, x, obj, index, y) {
                      return index.row + index.settings._iDisplayStart + 1;
                  }
              }, 
              {
            	  "targets": [1,2],
            	  createdCell: function (td,cellData,row,rowData,col) {
  	                var rowspan = row.markNum;
  	                if (rowspan > 0) {
  	                	$(td).attr('rowspan', rowspan);  	                	
  	                }
  	                if (rowspan == 0) {  	                    
  	                	$(td).remove();
  	                }
  	            }
      			},
              {
                  "targets": [7],
                  "render": function (data, type, row) {
                  	return "<p class=\"insDate\">"+fmtDateDr(row.insDate);+"</p>"
                  	}
              },
              {
                  "targets": [8],
                  "render": function (data, type, row) {
                  	return "<a onclick=\"getDrRaninsResTableDetail("+"\'"+row.url+"\'"+")\" class=\"delete\">详细</a>"
                  	}
              }
          ]
      });
});


//预加载详细
//$(function getDrRaninsResTableDetail(url){
//	var drraninsResColumns = ["index",
//			"raninsItemName",
//			"raninsCheckResName"
//      ];
//	 var drRaninsResDetailTable = $("#drRaninsResTableDetail").DataTable({ 
//		"bAutoWidth": false,
//		"bDestroy" : true,
//		"processing": true,
//		"serverSide": true,
//		"ordering": false,
//		"retrieve": true,
//		"iDisplayLength":10,
//		"pagingType": "full_numbers",
//		"language": {
//           "processing": "正在加载，请稍后",
//           "lengthMenu": "显示 _MENU_ 项结果",
//           "zeroRecords": "暂无公告信息",
//           "info": "共 查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
//           "infoEmpty": "共 查询到 0 条记录    共 0 页",
//           "infoFiltered": "(由 _MAX_ 项结果过滤)",
//           "infoPostFix": "",
//           "paginate": {
//               "first": "首页",
//               "previous": "上一页",
//               "next": "下一页",
//               "last": "末页"
//           }
//       },
//       "ajax": {
//    	   "url":url,
//           "type": "GET",
//           "error":function(){
//               now_sec = 'keyperson';
//           }
//       },
//       "columns": tablecolumns(drraninsResColumns),
//
//       "columnDefs": [ 
//            {
//               "targets": [0],
//               "render": function (data, x, obj, index, y) {
//                   return index.row + index.settings._iDisplayStart + 1;
//               }
//           }
//       ]
//   });
//});
//获取双随机分页
function tablecolumns(columns) {
	    var list = new Array();
	    $.each(columns, function (x, value) {
	        var obj = new Object();
	        obj.data = value;
	        list.push(obj);
	    });
	    return list;
	}

//日期格式化
function fmtDateDr(obj){
	if (obj==null||obj==undefined||obj==''){
		return '';
	}
	    var date =  new Date(obj);
	    var y = 1900+date.getYear();
	    var m = "0"+(date.getMonth()+1);
	    var d = "0"+date.getDate();
	    return y+"-"+m.substring(m.length-2,m.length)+"-"+d.substring(d.length-2,d.length);
	}

//获取双随机详情
function getDrRaninsResTableDetail(url){

	var drraninsResColumns = ["index",
			"raninsItemName",
			"raninsCheckResName"
       ];
	
	drRaninsResDetailTable = $("#drRaninsResTableDetail").DataTable({ 
		"bAutoWidth": false,
		"bDestroy" : true,
		"processing": true,
		"serverSide": true,
		"ordering": false,
		"retrieve": true,
		"iDisplayLength":5,
		"pagingType": "full_numbers",
		"language": {
           "processing": "正在加载，请稍后",
           "lengthMenu": "显示 _MENU_ 项结果",
           "zeroRecords": "暂无信息",
           "info": "共查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
           "infoEmpty": "共 查询到 0 条记录    共 0 页",
           "infoFiltered": "(由 _MAX_ 项结果过滤)",
           "infoPostFix": "",
           "paginate": {
               "first": "首页",
               "previous": "上一页",
               "next": "下一页",
               "last": "末页"
           }
       },
       "ajax": {
    	   "url":url,
           "type": "GET",
           "error":function(){
               now_sec = 'keyperson';
           }
       },
       "columns": tablecolumns(drraninsResColumns),

       "columnDefs": [ 
            {
               "targets": [0],
               "render": function (data, x, obj, index, y) {
                   return index.row + index.settings._iDisplayStart + 1;
               }
           }
       ]
   });
	drRaninsResDetailTable.destroy();
	$("#drranins-res-detail").css('display','block'); 
	document.getElementById("bg").style.display ="block";
	drRaninsResDetailTable = $("#drRaninsResTableDetail").DataTable({ 
		"bAutoWidth": false,
		"bDestroy" : true,
		"processing": true,
		"serverSide": true,
		"ordering": false,
		"retrieve": true,
		"iDisplayLength":5,
		"pagingType": "full_numbers",
		"language": {
           "processing": "正在加载，请稍后",
           "lengthMenu": "显示 _MENU_ 项结果",
           "zeroRecords": "暂无信息",
           "info": "共查询到 _TOTAL_ 条记录    共 _PAGES_ 页 ",
           "infoEmpty": "共 查询到 0 条记录    共 0 页",
           "infoFiltered": "(由 _MAX_ 项结果过滤)",
           "infoPostFix": "",
           "paginate": {
               "first": "首页",
               "previous": "上一页",
               "next": "下一页",
               "last": "末页"
           }
       },
       "ajax": {
           "url":url,
           "type": "GET",
           "async": false,
           "error":function(){
               now_sec = 'keyperson';
           }
       },
       "columns": tablecolumns(drraninsResColumns),

       "columnDefs": [ 
            {
               "targets": [0],
               "render": function (data, x, obj, index, y) {
                   return index.row + index.settings._iDisplayStart + 1;
               }
           }
       ]
   });
}